event_move_object |
Discworld events help |
event_move_object |
Name
event_move_object - Called on the object when it successfully moves.
Syntax
void event_move_object(mixed from, mixed to);
Description
This is the function called on things when they are successfully moved, after the move has actually taken place and just before MOVE_OK is returned to the caller of move. The from argument is where the object came from before it got to where it currently. The to argument which should be equal to environment(). The call is made using a call_out so that shadows make use the event. This event is not a true event in that it does not use the event system. If anything substantial is to be done by event_move_object a call_out should be invoked so that move can return promptly.
Examples:
void event_move_object(mixed from, mixed to) {
call_out("this_npc_moved", 5, from, to);
}
} /* event_move_object() */
void this_npc_moved(mixed from, mixed to) {
/* Make the NPC go home again */
if (!query_following_route() && environment()!= MY_HOME )
this_object()->move_me_to( MY_HOME );
} /* this_npc_moved() */
See also
move, event_enter, event_exit, event_destruct