From 540eda2af9a21148a3d75a3db1964465de6064ad Mon Sep 17 00:00:00 2001 From: AG <43139552+AGandrup@users.noreply.github.com> Date: Wed, 20 Sep 2023 22:48:23 +0200 Subject: [PATCH] fix(Core/Unit): Added bluewall AoE check (#17064) * Added bluewall AoE check - AoE spells/abilities done by non-flagged players now has no effect on pvp flagged players. * Crash fix * Update Unit.cpp Allow spells with flag "SPELL_ATTR5_IGNORE_AREA_EFFECT_PVP_CHECK" to pass this check. --- src/server/game/Entities/Unit/Unit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 57674dd6d..a42fb492d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13956,6 +13956,9 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo // additional checks - only PvP case if (playerAffectingAttacker && playerAffectingTarget) { + if (!IsPvP() && bySpell && bySpell->IsAffectingArea() && !bySpell->HasAttribute(SPELL_ATTR5_IGNORE_AREA_EFFECT_PVP_CHECK)) + return false; + if (target->IsPvP()) return true;