From 432dcda69503a7c5d5dda33d636d58b5f2d12c2d Mon Sep 17 00:00:00 2001 From: aleos89 Date: Sat, 3 Sep 2016 12:16:55 -0400 Subject: [PATCH] Corrected script command unitwalk (fixes #1535) * Resolved the event label not triggering when the unit reaches the destination. Thanks to Cyan Hijirikawa! --- src/map/unit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/map/unit.c b/src/map/unit.c index f8f29fb6eb..15ec959bbe 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -407,10 +407,11 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl); ud->walktimer = INVALID_TIMER; - if (ud->state.walk_script && bl->x == ud->to_x && bl->y == ud->to_y) { + if (bl->x == ud->to_x && bl->y == ud->to_y) { if (ud->walk_done_event[0]) npc_event_do_id(ud->walk_done_event,bl->id); - ud->state.walk_script = 0; + if (ud->state.walk_script) + ud->state.walk_script = 0; } switch(bl->type) {