summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/atcommand.cpp6
-rw-r--r--src/map/script-fun.cpp12
2 files changed, 11 insertions, 7 deletions
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<map_session_data> 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<map_session_data> 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 a06eb1b..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<map_session_data *>(s->session_data.get());
+ dumb_ptr<map_session_data> pl_sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(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);
}
}
}
@@ -2316,7 +2317,7 @@ void builtin_pvpoff(ScriptState *st)
{
MapName str = stringish<MapName>(ZString(conv_str(st, &AARG(0))));
P<map_local> m = TRY_UNWRAP(map_mapname2mapid(str), return);
- if (m->flag.get(MapFlag::PVP) && m->flag.get(MapFlag::NOPVP))
+ if (m->flag.get(MapFlag::PVP))
{
m->flag.set(MapFlag::PVP, 0);
@@ -2328,12 +2329,13 @@ void builtin_pvpoff(ScriptState *st)
Session *s = get_session(i);
if (!s)
continue;
- map_session_data *pl_sd = static_cast<map_session_data *>(s->session_data.get());
+ dumb_ptr<map_session_data> pl_sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(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);
}
}
}