*Fix abolish poison. (Set caster be taget when range = 0 and target type = single target)

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-21 14:01:26 -06:00
parent 77cd31a92b
commit 1759a7cf5c
4 changed files with 130 additions and 120 deletions

View File

@@ -894,15 +894,28 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
SpellCastTargets targets;
uint32 targetMask = spellInfo->Targets;
targets.setUnitTarget(Victim);
/*if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2))
//if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2))
for(int i = 0; i < 3; ++i)
{
if(!Victim)
if(spellmgr.SpellTargetType[spellInfo->EffectImplicitTargetA[i]] == TARGET_TYPE_UNIT_TARGET)
{
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;
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
if(srange && GetSpellMaxRange(srange) == 0.0f)
{
Victim = this;
break;
}
else 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()));
return;
}
else
break;
}
}*/
}
targets.setUnitTarget(Victim);
if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION))
{
if(!Victim)