From 4f0894c4f9f8a5d0f810c8d78bdf1ad476c37fba Mon Sep 17 00:00:00 2001 From: Sader Fawall Date: Sat, 18 Jan 2020 01:29:56 +0200 Subject: [PATCH] Fixed unitwalk with the same event name (#4204) Fixes #4118 --- src/map/unit.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/map/unit.cpp b/src/map/unit.cpp index b686c504ea..0643a2e33b 100644 --- a/src/map/unit.cpp +++ b/src/map/unit.cpp @@ -416,6 +416,9 @@ static TIMER_FUNC(unit_walktoxy_timer){ // Copying is required in case someone uses unitwalkto inside the event code safestrncpy(walk_done_event, ud->walk_done_event, EVENT_NAME_LENGTH); + //Clear the event + ud->walk_done_event[0] = 0; + ud->state.walk_script = true; // Execute the event @@ -434,11 +437,6 @@ static TIMER_FUNC(unit_walktoxy_timer){ return 0; } - // Check if another event was set - if( !strcmp(ud->walk_done_event,walk_done_event) ){ - // If not remove it - ud->walk_done_event[0] = 0; - } } }