summaryrefslogtreecommitdiff
path: root/src/map/magic-stmt.cpp
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2015-06-19 21:54:16 -0500
committerWushin <pasekei@gmail.com>2015-06-19 21:54:16 -0500
commitf008d4510f391aa802c31bc06b7cac2628a8b3fb (patch)
treeb8f43ed53a221fdc36355849613c57ff26777f6c /src/map/magic-stmt.cpp
parent8b4faba9b55ea4a0f3c8f6e5cbcd5fcff3509247 (diff)
parent2d8dd9049a22034d6727f082d428f8c10c8c8606 (diff)
downloadtmwa-f008d4510f391aa802c31bc06b7cac2628a8b3fb.tar.gz
tmwa-f008d4510f391aa802c31bc06b7cac2628a8b3fb.tar.bz2
tmwa-f008d4510f391aa802c31bc06b7cac2628a8b3fb.tar.xz
tmwa-f008d4510f391aa802c31bc06b7cac2628a8b3fb.zip
Merge pull request #103 from mekolat/pvp
Pvp enhancements
Diffstat (limited to 'src/map/magic-stmt.cpp')
-rw-r--r--src/map/magic-stmt.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp
index 4d8330a..1a8085b 100644
--- a/src/map/magic-stmt.cpp
+++ b/src/map/magic-stmt.cpp
@@ -771,10 +771,12 @@ int op_injure(dumb_ptr<env_t> env, Slice<val_t> args)
int target_hp = battle_get_hp(target);
int mdef = battle_get_mdef(target);
- if (target->bl_type == BL::PC
- && !target->bl_m->flag.get(MapFlag::PVP)
- && (caster->bl_type == BL::PC)
- && ((caster->is_player()->state.pvpchannel > 1) && (target->is_player()->state.pvpchannel != caster->is_player()->state.pvpchannel)))
+ if (target->bl_type == BL::PC // target is player
+ && !target->bl_m->flag.get(MapFlag::PVP) // there is no pvpon flag
+ && (caster->bl_type == BL::PC) // caster is player
+ && ((target->is_player()->state.pvpchannel == 0)
+ || ((caster->is_player()->state.pvpchannel > 0)
+ && (target->is_player()->state.pvpchannel != caster->is_player()->state.pvpchannel))))
return 0; /* Cannot damage other players outside of pvp */
if (target != caster)