From c0d49b879e2a8f85e72f5ea7741528974a05c6ba Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 26 Dec 2017 15:13:48 -0500 Subject: [PATCH] Core/Unit: consider creatures with same faction to be on the same party/raid for the purposes of spell/aura targets --- Source/Game/Entities/Unit/Unit.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 7e4fb36ac..669975002 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -2655,8 +2655,9 @@ namespace Game.Entities else if ((u2.IsTypeId(TypeId.Player) && u1.IsTypeId(TypeId.Unit) && u1.ToCreature().GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.TreatAsRaidUnit)) || (u1.IsTypeId(TypeId.Player) && u2.IsTypeId(TypeId.Unit) && u2.ToCreature().GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.TreatAsRaidUnit))) return true; - else - return false; + + // else u1->GetTypeId() == u2->GetTypeId() == TYPEID_UNIT + return u1.getFaction() == u2.getFaction(); } public bool IsInRaidWith(Unit unit) @@ -2674,8 +2675,9 @@ namespace Game.Entities else if ((u2.IsTypeId(TypeId.Player) && u1.IsTypeId(TypeId.Unit) && u1.ToCreature().GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.TreatAsRaidUnit)) || (u1.IsTypeId(TypeId.Player) && u2.IsTypeId(TypeId.Unit) && u2.ToCreature().GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.TreatAsRaidUnit))) return true; - else - return false; + + // else u1->GetTypeId() == u2->GetTypeId() == TYPEID_UNIT + return u1.getFaction() == u2.getFaction(); } public SheathState GetSheath() { return (SheathState)GetByteValue(UnitFields.Bytes2, UnitBytes2Offsets.SheathState); }