From 650aa566b08812ef4ce4ee0ae85344a6e35097b6 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 16 Nov 2014 09:37:26 -0500 Subject: [PATCH] Fix for perl CastSpell function so it will use a spells innate resist diff settings if no override value is put in the function. Due to recent changes in how we defined that variable it would set it to 0 resist diff by default when called from perl. --- zone/perl_mob.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 17ac9c3ac..af63066ff 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -3971,7 +3971,10 @@ XS(XS_Mob_CastSpell) resist_adjust = (int16)SvIV(ST(6)); } - THIS->CastSpell(spell_id, target_id, slot, casttime, mana_cost, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, &resist_adjust); + if (resist_adjust == 0)//If you do not pass resist adjust as nullptr it will ignore the spells default resist adjust + THIS->CastSpell(spell_id, target_id, slot, casttime, mana_cost, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0); + else + THIS->CastSpell(spell_id, target_id, slot, casttime, mana_cost, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, &resist_adjust); } XSRETURN_EMPTY; }