Merge pull request #281 from KayenEQ/Development

Fix to SE_PercentHeal to allow it to work if no max value set.
This commit is contained in:
Michael Cook (mackal) 2014-11-06 02:47:06 -05:00
commit b8b43c7149

View File

@ -299,7 +299,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
//This effect can also do damage by percent. //This effect can also do damage by percent.
if (val < 0) { if (val < 0) {
if (-val > spell.max[i]) if (spell.max[i] && -val > spell.max[i])
val = -spell.max[i]; val = -spell.max[i];
if (caster) if (caster)
@ -309,7 +309,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
else else
{ {
if (val > spell.max[i]) if (spell.max[i] && val > spell.max[i])
val = spell.max[i]; val = spell.max[i];
if(caster) if(caster)
@ -2647,7 +2647,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_Taunt: case SE_Taunt:
{ {
if (IsNPC()){ if (IsNPC()){
caster->Taunt(this->CastToNPC(), false, spell.base[i]); caster->Taunt(this->CastToNPC(), false, static_cast<float>(spell.base[i]));
if (spell.base2[i] > 0) if (spell.base2[i] > 0)
CastToNPC()->SetHate(caster, (CastToNPC()->GetHateAmount(caster) + spell.base2[i])); CastToNPC()->SetHate(caster, (CastToNPC()->GetHateAmount(caster) + spell.base2[i]));