[11288] Check IsPositiveEffect in IsPositiveSpell only for existed effects.

Thanks to NoFantasy for problem research.

Also make IsPositiveEffect use SpellEntry* arg instead spell id.
This commit is contained in:
VladimirMangos 2011-03-26 03:05:48 +03:00
parent dae28ae93a
commit 989d229968
9 changed files with 24 additions and 21 deletions

View file

@ -92,11 +92,18 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, SpellE
SetFloatValue(DYNAMICOBJECT_RADIUS, radius);
SetUInt32Value(DYNAMICOBJECT_CASTTIME, WorldTimer::getMSTime()); // new 2.4.0
SpellEntry const* spellProto = sSpellStore.LookupEntry(spellId);
if (!spellProto)
{
sLog.outError("DynamicObject (spell %u) not created. Spell not exist!", spellId, GetPositionX(), GetPositionY());
return false;
}
m_aliveDuration = duration;
m_radius = radius;
m_effIndex = effIndex;
m_spellId = spellId;
m_positive = IsPositiveEffect(m_spellId, m_effIndex);
m_positive = IsPositiveEffect(spellProto, m_effIndex);
return true;
}