diff options
author | megamage <none@none> | 2008-12-21 14:01:26 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-21 14:01:26 -0600 |
commit | 1759a7cf5cc7ca5bdcd6c28041ab46a2b143e5d3 (patch) | |
tree | cf2e4dcbfe631f8961a5299899b71c78f2e886d0 /src/game/Unit.cpp | |
parent | 77cd31a92bb01cbb264335428226b651ddf1aa06 (diff) |
*Fix abolish poison. (Set caster be taget when range = 0 and target type = single target)
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a4a08bb40f1..48cda18893d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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) |