From b7b65eacf2724a0548f7c9ed34ccef8e649d118c Mon Sep 17 00:00:00 2001 From: Supabad Date: Tue, 19 Oct 2010 13:15:47 +0200 Subject: Core/Spells: Destructable Buildings - Fix issue where damage can be done to GameObjects with hp 0 - add check for Gameobjects with faction 0 --HG-- branch : trunk --- src/server/game/Spells/SpellEffects.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0f34ea7a553..a36f639c1c9 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6760,11 +6760,15 @@ void Spell::EffectWMODamage(SpellEffIndex /*effIndex*/) if (!caster) return; + // Do not allow damage if hp is 0 + if (gameObjTarget->GetGOValue()->building.health == 0) + return; + FactionTemplateEntry const *casterft, *goft; casterft = caster->getFactionTemplateEntry(); goft = sFactionTemplateStore.LookupEntry(gameObjTarget->GetUInt32Value(GAMEOBJECT_FACTION)); - // Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls) - if (casterft && goft && !casterft->IsFriendlyTo(*goft)) + // Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls/Ulduar Storm Beacons) + if ((casterft && goft && !casterft->IsFriendlyTo(*goft)) || !goft) { gameObjTarget->TakenDamage(uint32(damage), caster); WorldPacket data(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, 8+8+8+4+4); -- cgit v1.2.3