*Fix the bug that some creature spells are broken.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-09 10:20:02 -06:00
parent b5476118f2
commit d3c2c31e2e
+6 -6
View File
@@ -862,15 +862,15 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
SpellCastTargets targets; SpellCastTargets targets;
uint32 targetMask = spellInfo->Targets; uint32 targetMask = spellInfo->Targets;
if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2)) targets.setUnitTarget(Victim);
/*if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2))
{ {
if(!Victim) if(!Victim)
{ {
sLog.outError("CastSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); sLog.outError("CastSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return; return;
} }
targets.setUnitTarget(Victim); }*/
}
if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION)) if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION))
{ {
if(!Victim) if(!Victim)
@@ -916,15 +916,15 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const
SpellCastTargets targets; SpellCastTargets targets;
uint32 targetMask = spellInfo->Targets; uint32 targetMask = spellInfo->Targets;
if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2)) targets.setUnitTarget(Victim);
/*if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2))
{ {
if(!Victim) if(!Victim)
{ {
sLog.outError("CastCustomSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); sLog.outError("CastCustomSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return; return;
} }
targets.setUnitTarget(Victim); }*/
}
if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION)) if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION))
{ {
if(!Victim) if(!Victim)