From d18f5bdb682a1d9c6e3a191926bfd46d36e813c1 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 17 Apr 2013 13:22:58 -0700 Subject: Force timers to be managed --- src/map/atcommand.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/map/atcommand.cpp') diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index ea13a04..5fffaa3 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -1898,11 +1898,7 @@ int atcommand_pvpoff(const int fd, struct map_session_data *sd, { if (sd->bl.m == pl_sd->bl.m) { - if (pl_sd->pvp_timer) - { - delete_timer(pl_sd->pvp_timer); - pl_sd->pvp_timer = nullptr; - } + pl_sd->pvp_timer.cancel(); } } } @@ -1943,7 +1939,7 @@ int atcommand_pvpon(const int fd, struct map_session_data *sd, { if (sd->bl.m == pl_sd->bl.m && !pl_sd->pvp_timer) { - pl_sd->pvp_timer = add_timer(gettick() + std::chrono::milliseconds(200), + pl_sd->pvp_timer = Timer(gettick() + std::chrono::milliseconds(200), std::bind(pc_calc_pvprank_timer, ph::_1, ph::_2, pl_sd->bl.id)); pl_sd->pvp_rank = 0; pl_sd->pvp_lastusers = 0; @@ -6049,7 +6045,7 @@ int atcommand_summon(const int, struct map_session_data *sd, md->master_id = sd->bl.id; md->state.special_mob_ai = 1; md->mode = mob_db[md->mob_class].mode | MobMode::AGGRESSIVE; - md->deletetimer = add_timer(tick + std::chrono::minutes(1), + md->deletetimer = Timer(tick + std::chrono::minutes(1), std::bind(mob_timer_delete, ph::_1, ph::_2, id)); clif_misceffect(&md->bl, 344); -- cgit v1.2.3-60-g2f50