Core/Units: defined all faction template flags and properly implemented FactionTemplateFlags::HatesAllExceptFriends

*refactored FactionTemplateEntry helpers to use pointers instead of references since we use datastore pointers in all cases so there is no need to create references
This commit is contained in:
Ovahlord committed 2022-08-10 20:28:47 +02:00
1 parent 45af6bbd4b
commit fd27f0020d
7 files changed
+69 -55

No files matched your search

+1 -1
View File
@@ -5314,7 +5314,7 @@ void Spell::EffectGameObjectDamage(SpellEffIndex /*effIndex*/)
FactionTemplateEntry const* casterFaction = caster->GetFactionTemplateEntry();
FactionTemplateEntry const* targetFaction = sFactionTemplateStore.LookupEntry(gameObjTarget->GetFaction());
// Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls/Ulduar Storm Beacons)
if (!targetFaction || (casterFaction && !casterFaction->IsFriendlyTo(*targetFaction)))
if (!targetFaction || (casterFaction && !casterFaction->IsFriendlyTo(targetFaction)))
gameObjTarget->ModifyHealth(-damage, caster, GetSpellInfo()->Id);
}