ID:273072
 
I have a proc that is called to keep an object moving when its called. However I want the object to stop moving when it enters a certain turf(that has no density). For simplicity sake lets call this glue. I have an entered proc for this glue but I'd rather code something to make the obj stop moving inside the proc shown below, not the entered proc.
This is my proc:
proc/MoveStone(rock,direction)
sleep(5)
if(step(rock,dire)) //if the stone can move move it
MoveStone(rock,direction)
First of all, you should not be calling the proc within the proc like that for the purposes of looping. It's called recursion and it has specific uses, but if you use it in no-exit cases such as this one, you will overflow the stack and it will crash. So, instead, what you should do is this:

proc/MoveStone(obj/rock, direction)
while(rock.canmove && step(rock, dir))
sleep(5)