From b2db882ac857b7dbba43009c3ddf89711c46cb14 Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 16 Jun 2015 13:31:13 -0400 Subject: do not allow to attack PC with magic when on channel 0 --- src/map/magic-stmt.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/map/magic-stmt.cpp') 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, Slice 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) -- cgit v1.2.3-60-g2f50