ID:141488
 
Code:
turf
Enter()
if(usr.underwater == 1)
if(src.iswater == 1)
if(usr.dir == NORTH)
usr.loc = locate(usr.x,usr.y+1,usr.z)
usr.moving = 1
sleep(usr.rundelay)
usr.moving = 0
if(usr.dir == SOUTH)
usr.loc = locate(usr.x,usr.y-1,usr.z)
usr.moving = 1
sleep(usr.rundelay)
usr.moving = 0
if(usr.dir == EAST)
usr.loc = locate(usr.x+1,usr.y,usr.z)
usr.moving = 1
sleep(usr.rundelay)
usr.moving = 0
if(usr.dir == WEST)
usr.loc = locate(usr.x-1,usr.y,usr.z)
usr.moving = 1
sleep(usr.rundelay)
usr.moving = 0
else
..()


Problem description: Im pretty sure it works for whenever your underwater however whenever your not it doesnt let you move..

Ungh. No usr in proc.
Also, that's generally bad code there, but you should simply check if the var's value is true by testing it directly rather than comparing it to 1, and you should look up Enter() to see how it works and how you're supposed to use it to control movement; definitely not by setting the loc var like that - Enter() should really never do any actual action that affects something at all, it should only calculate what it needs to determine what it should return. On a similar note, calling the parent proc there and doing nothing with (and therefore losing) its return value is really more or less the same as not calling it at all.
In response to Kaioken
I don't see how that would help me x.x the problem is the else ..() that's it, I just want to know how to make it let me walk through my turfs again..
In response to SadoSoldier
Never mind I fixed it..