From e885f2d08fa4c8ba08a14b87ec20dd24806b5f6b Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 25 Feb 2013 12:36:56 -0800 Subject: Fix walk bug exposed by assertion --- src/map/pc.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/map/pc.cpp') diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 8a4a98f..b192aae 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -2659,6 +2659,7 @@ void pc_walk(TimerData *tid, tick_t tick, int id, unsigned char data) i = i / 2; if (sd->walkpath.path_half == 0) i = std::max(i, std::chrono::milliseconds(1)); + assert (!sd->walktimer); sd->walktimer = add_timer(tick + i, std::bind(pc_walk, ph::_1, ph::_2, id, sd->walkpath.path_pos)); @@ -2687,6 +2688,8 @@ int pc_walktoxy_sub(struct map_session_data *sd) if (i > interval_t::zero()) { i = i / 4; + if (sd->walktimer) + delete_timer(sd->walktimer); sd->walktimer = add_timer(gettick() + i, std::bind(pc_walk, ph::_1, ph::_2, sd->bl.id, 0)); -- cgit v1.2.3-60-g2f50