summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-02-25 12:36:56 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-02-25 12:36:56 -0800
commite885f2d08fa4c8ba08a14b87ec20dd24806b5f6b (patch)
treecc82f1a9c4a3014be48e41b09ebee183182d8d75 /src/map
parent2d226bd3e09417d8f2cf60d92c92b0dd437e4230 (diff)
downloadtmwa-e885f2d08fa4c8ba08a14b87ec20dd24806b5f6b.tar.gz
tmwa-e885f2d08fa4c8ba08a14b87ec20dd24806b5f6b.tar.bz2
tmwa-e885f2d08fa4c8ba08a14b87ec20dd24806b5f6b.tar.xz
tmwa-e885f2d08fa4c8ba08a14b87ec20dd24806b5f6b.zip
Fix walk bug exposed by assertion
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.cpp3
1 files changed, 3 insertions, 0 deletions
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));