Просмотр исходного кода

Corrected script command unitwalk (fixes #1535)
* Resolved the event label not triggering when the unit reaches the destination.
Thanks to Cyan Hijirikawa!

aleos89 8 лет назад
Родитель
Сommit
432dcda695
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/map/unit.c

+ 3 - 2
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) {