HellRazor
Knight
Bug Fix in SVN - SpellHelper.cs
While playing around with the XMLAttachments system I found a bug in SpellHelper.cs.
SpellHelper.cs has a method to call Damage where the source of the spell (from) is NULL.
XMLAttachments make use of this so you can add an attachment to say, a cannon, and make it fire spells at people who come into range.
The bug pops up later in SpellHelper.cs when DoLeech is called. DoLeech requires from to be a mobile, but has no error checking. This results in a crash if from is null.
To fix, right before:
add:
Also, in the OnTick method, right before:
Add:
While playing around with the XMLAttachments system I found a bug in SpellHelper.cs.
SpellHelper.cs has a method to call Damage where the source of the spell (from) is NULL.
Code:
public static void Damage( TimeSpan delay, Mobile target, double damage, int phys, int fire, int cold, int pois, int nrgy )
{
Damage( delay, target, null, damage, phys, fire, cold, pois, nrgy );
}
XMLAttachments make use of this so you can add an attachment to say, a cannon, and make it fire spells at people who come into range.
The bug pops up later in SpellHelper.cs when DoLeech is called. DoLeech requires from to be a mobile, but has no error checking. This results in a crash if from is null.
To fix, right before:
Code:
DoLeech( damageGiven, from, target );
add:
Code:
if (from != null )
Also, in the OnTick method, right before:
Code:
DoLeech( damageGiven, m_From, m_Target );
Add:
Code:
if( m_From != null )