diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-04-17 13:22:58 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-04-27 14:09:22 -0700 |
commit | d18f5bdb682a1d9c6e3a191926bfd46d36e813c1 (patch) | |
tree | c987d53ea924b761e5445572a438e0c4bc825d48 /src/map/map.cpp | |
parent | da6b990ca1f553a017003f32a436304c66c62b9e (diff) | |
download | tmwa-d18f5bdb682a1d9c6e3a191926bfd46d36e813c1.tar.gz tmwa-d18f5bdb682a1d9c6e3a191926bfd46d36e813c1.tar.bz2 tmwa-d18f5bdb682a1d9c6e3a191926bfd46d36e813c1.tar.xz tmwa-d18f5bdb682a1d9c6e3a191926bfd46d36e813c1.zip |
Force timers to be managed
Diffstat (limited to 'src/map/map.cpp')
-rw-r--r-- | src/map/map.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp index 63fc8c9..152b3c8 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -759,15 +759,14 @@ void map_clearflooritem_timer(TimerData *tid, tick_t, int id) struct flooritem_data *fitem = NULL; fitem = (struct flooritem_data *) object[id]; - if (fitem == NULL || fitem->bl.type != BL::ITEM - || (tid && fitem->cleartimer != tid)) + if (fitem == NULL || fitem->bl.type != BL::ITEM) { if (battle_config.error_log) PRINTF("map_clearflooritem_timer : error\n"); return; } if (!tid) - delete_timer(fitem->cleartimer); + fitem->cleartimer.cancel(); clif_clearflooritem(fitem, 0); map_delobject(fitem->bl.id, BL::ITEM); } @@ -853,7 +852,7 @@ int map_addflooritem_any(struct item *item_data, int amount, // Currently, it yields the numbers {3 6 9 12}. fitem->subx = random_::in(1, 4) * 3; fitem->suby = random_::in(1, 4) * 3; - fitem->cleartimer = add_timer(gettick() + lifetime, + fitem->cleartimer = Timer(gettick() + lifetime, std::bind(map_clearflooritem_timer, ph::_1, ph::_2, fitem->bl.id)); |