summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-08 16:22:16 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-08 16:54:18 -0400
commit156d0235bec78dac6abc55fb5ff54b263304525f (patch)
tree484373fe6b59d7832888fe8f24b9890f5207db22
parent58d77868475d2dbdd2914cd99e45442ceb0eaf8b (diff)
downloadtmwa-156d0235bec78dac6abc55fb5ff54b263304525f.tar.gz
tmwa-156d0235bec78dac6abc55fb5ff54b263304525f.tar.bz2
tmwa-156d0235bec78dac6abc55fb5ff54b263304525f.tar.xz
tmwa-156d0235bec78dac6abc55fb5ff54b263304525f.zip
send updated map pvp status on pvpon/pvpoff
-rw-r--r--src/map/atcommand.cpp6
-rw-r--r--src/map/script-fun.cpp10
2 files changed, 10 insertions, 6 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 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<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);
}
}
}
@@ -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);
}
}
}