*Wintergrasp: Set Faction on workshop capture + GO check faction fix, by Spp

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-13 23:04:11 -07:00
parent 832159de12
commit 075989a8a4
3 changed files with 12 additions and 26 deletions
+1 -5
View File
@@ -7043,13 +7043,9 @@ void Spell::EffectWMODamage(uint32 /*i*/)
if(!caster)
return;
const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(gameObjTarget->GetEntry());
if (!gInfo)
return;
FactionTemplateEntry const *casterft, *goft;
casterft = caster->getFactionTemplateEntry();
goft = sFactionTemplateStore.LookupEntry(gInfo->faction);
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))
gameObjTarget->TakenDamage((uint32)damage);