Fixed broken missile visuals in certain DST and SRC type spells (Void Reaver's Arcane Orb and many others). Achieved by fixing wildly incorrect SMSG_SPELL_GO target mask data handling.

--HG--
branch : trunk
This commit is contained in:
Xanadu committed 2010-03-19 00:21:57 +01:00
1 parent 35a7f4849e
commit 812874a55b
5 files changed
+99 -89

No files matched your search

-58
View File
@@ -884,39 +884,8 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
originalCaster=owner->GetGUID();
SpellCastTargets targets;
uint32 targetMask = spellInfo->Targets;
//if (targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2))
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (SpellTargetType[spellInfo->EffectImplicitTargetA[i]] == TARGET_TYPE_UNIT_TARGET)
{
/*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)
{
sLog.outError("CastSpell: spell id %i by caster: %s %u) does not have destination", spellInfo->Id,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
targets.setDst(Victim);
}
if (castItem)
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
@@ -958,35 +927,8 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit*
}
SpellCastTargets targets;
uint32 targetMask = spellInfo->Targets;
//check unit target
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (SpellTargetType[spellInfo->EffectImplicitTargetA[i]] == TARGET_TYPE_UNIT_TARGET)
{
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);
//check destination
if (targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION))
{
if (!Victim)
{
sLog.outError("CastSpell: spell id %i by caster: %s %u) does not have destination", spellInfo->Id,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
targets.setDst(Victim);
}
if (!originalCaster && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();