turf
Door_Mats
icon = 'Turfs.dmi'
icon_state = "Door Mat"
var/Distance = 5
proc/Entah()
..()
for(var/obj/door/d in oview(src.Distance))
d.toggle()
Door_Click
icon = 'Turfs.dmi'
icon_state = "Door Mat"
Entered()
..()
for(var/turf/Door_Mats/d in oview(5))
d.Entah()
obj
icon='Icons/Turfs.dmi'
door
var/opening
name="Door"
density=1
proc/toggle()
if(opening)return
opening=1
if(icon_state=="open")
flick("closing",src)
density=1
sleep(times)
icon_state=""
else if(!icon_state)
flick("opening",src)
sleep(times)
density=0
icon_state="open"
opening=0
Problem description:
The code does what I want it to perfectly, when I step on Door_Click, any Door_Mat within 5 spaces does its proc, which opens the doors nearby it. The problem with the code is, when I step on the pad, it won't allow me onto the square, though it'll start to open doors. I can walk around, and once the doors are opened, it teleports me to the square. I understand that this is because it's doing the procedure before the moving, but I need to know a way so it moves me THEN initiates the procedure.