aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeader <keader.android@gmail.com>2016-10-14 18:41:38 -0300
committerjoschiwald <joschiwald.trinity@gmail.com>2017-10-03 15:31:22 +0200
commitff90a3f3c46c778a993c90470f278ef12e57c7a1 (patch)
tree7e25a63333c16397a2b214a1ca606e0c147e4f83 /src
parent53dde7e2ca04dd2773eaad751ac04a7ab3fcf75f (diff)
Core/Unit: Remove incorrect check that dont allow units attack your vehicle/passenger (#17932)
(cherry picked from commit f0cd28be3d1b3ca3632d2b92cce55858f6025071)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4ba7c8501c9..0afe6e08c37 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -7915,11 +7915,6 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|| (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster()))
return false;
- // can't attack own vehicle or passenger
- if (m_vehicle)
- if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
- return false;
-
// can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. Ignore stealth if target is player and unit in combat with same player
if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea(GetMap()->GetDifficultyID())) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea(GetMap()->GetDifficultyID())) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target)))))
return false;