aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-24 11:20:23 -0600
committermegamage <none@none>2008-12-24 11:20:23 -0600
commit24a5af843f55a5632ecafef6b4fafc114b60b3a7 (patch)
tree0ab55bb888b09f2393b948b18a15987d0800b836 /src/game/Unit.cpp
parent184b82abccfff95b18bed81ded1b5a7e98d2dbd3 (diff)
parent4a917033c5da12c838d47bff6798434a1698655a (diff)
*Backout the patch committed by mistake.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e00b2446010..86d1d23be75 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12943,8 +12943,25 @@ bool Unit::IsInRaidWith(Unit const *unit) const
return false;
}
-void Unit::GetRaidMember(std::list<Unit*> &TagUnitMap, float radius)
+void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
{
+ Player *owner = GetCharmerOrOwnerPlayerOrPlayerItself();
+ if(!owner)
+ return;
+
+ Group *pGroup = owner->GetGroup();
+ if(!pGroup)
+ return;
+
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
+
+ // IsHostileTo check duel and controlled by enemy
+ if( Target && Target != this && Target->isAlive()
+ && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
+ nearMembers.push_back(Target);
+ }
}
void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
@@ -12986,17 +13003,23 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
void Unit::AddAura(uint32 spellId, Unit* target)
{
- if(!target)
+ if(!target || !target->isAlive())
return;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if(!spellInfo)
return;
+ if (target->IsImmunedToSpell(spellInfo))
+ return;
+
for(uint32 i = 0; i < 3; ++i)
{
if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA)
{
+ if(target->IsImmunedToSpellEffect(spellInfo->Effect[i], spellInfo->EffectMechanic[i]))
+ continue;
+
if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER)
{
Aura *Aur = CreateAura(spellInfo, i, NULL, this, this);