Skip to content

Commit

Permalink
Relations Stage 2 Rollout: Migrate from IsFriendlyTo in Positive/Nega…
Browse files Browse the repository at this point in the history
…tive spell detection logic

To be fixed later.
  • Loading branch information
Warlockbugs committed Nov 8, 2017
1 parent 4cad793 commit 09af6de
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/game/Spells/SpellMgr.h
Expand Up @@ -868,24 +868,10 @@ inline bool IsNeutralEffectTargetPositive(uint32 etarget, const WorldObject* cas
return true; // Early self-cast detection

if (!caster)
return true; // TODO: Nice to have additional in-depth research for default value for nullcaster
return true;

const Unit* utarget = (const Unit*)target;
switch (caster->GetTypeId())
{
case TYPEID_UNIT:
case TYPEID_PLAYER:
return ((const Unit*)caster)->IsFriendlyTo(utarget);
case TYPEID_GAMEOBJECT:
return ((const GameObject*)caster)->IsFriendlyTo(utarget);
case TYPEID_DYNAMICOBJECT:
return ((const DynamicObject*)caster)->IsFriendlyTo(utarget);
case TYPEID_CORPSE:
return ((const Corpse*)caster)->IsFriendlyTo(utarget);
default:
break;
}
return true;
// TODO: Fix it later
return caster->IsFriend(static_cast<const Unit*>(target));
}

inline bool IsPositiveEffectTargetMode(const SpellEntry* entry, SpellEffectIndex effIndex, const WorldObject* caster = nullptr, const WorldObject* target = nullptr, bool recursive = false)
Expand Down

0 comments on commit 09af6de

Please sign in to comment.