summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-08 17:13:46 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-08 17:13:46 -0400
commitb981fb6627061a22626961451fb07404a9ef59f1 (patch)
tree84a3b7af0eb6582b18805e6bd0fd6f0fa070380c /src
parentacf616855d864fdce9ddc9ec7c5b655c67f36aec (diff)
parent156d0235bec78dac6abc55fb5ff54b263304525f (diff)
downloadtmwa-b981fb6627061a22626961451fb07404a9ef59f1.tar.gz
tmwa-b981fb6627061a22626961451fb07404a9ef59f1.tar.bz2
tmwa-b981fb6627061a22626961451fb07404a9ef59f1.tar.xz
tmwa-b981fb6627061a22626961451fb07404a9ef59f1.zip
Merge pull request #204 from mekolat/pvpfix
pvpoff fix
Diffstat (limited to 'src')
-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);
}
}
}