|
||
|
|||||||
| Modification Suggestions This is where you can suggest a modifcation to RunUO! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Age: 47
Posts: 4,753
|
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 );
}
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 ); Code:
if (from != null ) Code:
DoLeech( damageGiven, m_From, m_Target ); Code:
if( m_From != null ) Last edited by HellRazor; 02-20-2010 at 06:58 PM. Reason: Fixed a bug in the bug fix! |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Aug 2008
Location: Italia, near Britannia
Age: 24
Posts: 4,694
|
Surely I'm dumb and noob - but BaseCreature? I mean, do BaseCreature contain PlayerMobile also? Wouldn't this break the leeching effect for players?
What if, instead, the if statement checks Mobile instead of BaseCreature?
__________________
-- |
|
|
|
|
|
#3 (permalink) | |
|
Forum Expert
Join Date: Oct 2002
Age: 47
Posts: 4,753
|
Quote:
Should have just inserted a check to ensure from != null. I'll update my post to correct the fix. Thanks! |
|
|
|
|
|
|
#4 (permalink) | |
|
Forum Expert
Join Date: Aug 2008
Location: Italia, near Britannia
Age: 24
Posts: 4,694
|
Quote:
![]() I have also reported it in Demise forums since, as I stated almost everywhere, the RunUO official development is moving from there: maybe you want to have a look here too
__________________
-- |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|