From f0cd28be3d1b3ca3632d2b92cce55858f6025071 Mon Sep 17 00:00:00 2001 From: Keader Date: Fri, 14 Oct 2016 18:41:38 -0300 Subject: Core/Unit: Remove incorrect check that dont allow units attack your vehicle/passenger (#17932) --- src/server/game/Entities/Unit/Unit.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5313381737a..e270789c281 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8644,11 +8644,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()) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea()) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target))))) return false; -- cgit v1.2.3