ID:2242199
 
Code:
turf/Rocks
density=0
Rock1
icon='Rock.dmi'
var/_Dir
Enter(var/mob/M)
if(M.dir==_Dir)// && !M.Falling)
step(M,M.dir,24)
M.CancelMovement()
M.Falling=1
else ..()


Problem description:
Why when i try enter on tile with _Dir =EAST/WEST my project was crashed?
NORTH and SOUTH dirs works properly.

turf/Rocks
density=0
Rock1
icon='Rock.dmi'
var/_Dir
Enter(var/mob/M)
if(M.dir==_Dir)// && !M.Falling)
step(M,M.dir,24)
M.CancelMovement()
M.Falling=1
..() // I tend to leave this outside of the if statement.
// Since the if statment would only go through if the requirements are met. If not, then the enter would run as normal


Also, I don't see _dir labeled in the rock turf.

EDIT: I mean, it doesn't have value set [so would default ot null. Your direction cant be null, I believe]. So how can it even equal the _Dir?
In response to Meme01
Solved.

Kaiochao wrote:
Enter() is called before you step on something, and it's >only used to determine whether you're allowed to step on >it or not
if you move again in Enter(), then you might call Enter() >again, because you haven't actually entered yet
and that leads to an infinite loop
Entered() is called once you have entered the tile