From 156d0235bec78dac6abc55fb5ff54b263304525f Mon Sep 17 00:00:00 2001 From: mekolat Date: Fri, 8 Apr 2016 16:22:16 -0400 Subject: send updated map pvp status on pvpon/pvpoff --- src/map/atcommand.cpp | 6 ++++-- src/map/script-fun.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index f50cddf..f311c3e 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -1615,6 +1615,7 @@ ATCE atcommand_pvpoff(Session *s, dumb_ptr sd, if (sd->bl_m == pl_sd->bl_m) { pl_sd->pvp_timer.cancel(); + clif_map_pvp(pl_sd); } } } @@ -1674,8 +1675,9 @@ ATCE atcommand_pvpon(Session *s, dumb_ptr sd, { pl_sd->pvp_timer = Timer(gettick() + 200_ms, std::bind(pc_calc_pvprank_timer, ph::_1, ph::_2, pl_sd->bl_id)); - pl_sd->pvp_rank = 0; - pl_sd->pvp_point = 5; + //pl_sd->pvp_rank = 0; + //pl_sd->pvp_point = 5; + clif_map_pvp(pl_sd); } } } diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index ce765a2..9014d2b 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -2295,7 +2295,7 @@ void builtin_pvpon(ScriptState *st) Session *s = get_session(i); if (!s) continue; - map_session_data *pl_sd = static_cast(s->session_data.get()); + dumb_ptr pl_sd = dumb_ptr(static_cast(s->session_data.get())); if (pl_sd && pl_sd->state.auth) { if (m == pl_sd->bl_m && !pl_sd->pvp_timer) @@ -2303,8 +2303,9 @@ void builtin_pvpon(ScriptState *st) pl_sd->pvp_timer = Timer(gettick() + 200_ms, std::bind(pc_calc_pvprank_timer, ph::_1, ph::_2, pl_sd->bl_id)); - pl_sd->pvp_rank = 0; - pl_sd->pvp_point = 5; + //pl_sd->pvp_rank = 0; + //pl_sd->pvp_point = 5; + clif_map_pvp(pl_sd); } } } @@ -2328,12 +2329,13 @@ void builtin_pvpoff(ScriptState *st) Session *s = get_session(i); if (!s) continue; - map_session_data *pl_sd = static_cast(s->session_data.get()); + dumb_ptr pl_sd = dumb_ptr(static_cast(s->session_data.get())); if (pl_sd && pl_sd->state.auth) { if (m == pl_sd->bl_m) { pl_sd->pvp_timer.cancel(); + clif_map_pvp(pl_sd); } } } -- cgit v1.2.3-60-g2f50