need help, IDamageableItem Crash.

13440130

Well-Known Member
Jan 25, 2015
123
6
Server Crash Report
===================

ServUO Version 0.5, Build 6983.12228
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 4.0.30319.42000
Time: 2019/3/12 18:21:13
Mobiles: 44144
Items: 219808
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.BaseCreature.CanBeHarmful(IDamageable damageable, Boolean message, Boolean ignoreOurBlessedness)
at Server.Mobile.set_Combatant(IDamageable value)
at Server.Mobiles.BaseCreature.set_Combatant(IDamageable value)
at Server.Mobiles.MageAI.DoActionCombat()
at Server.Mobiles.BaseAI.DoOrderAttack()
at Server.Mobiles.BaseAI.AITimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)


When the pet attacked the lighthouse, it crashed.
 

Milva

Admin
Moderator
Mar 3, 2013
4,169
472
Donate
Donate money to this user
This would be the Lighthouse in ServUO with no changes made? If so I can send this to bug reports
 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,199
189
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
Agree. If you mean the InvasionBeacon, it is configured as "DamageableItem" not "IDamageableItem" which might be a problem if "CanBeHarmful" needs that.
 

13440130

Well-Known Member
Jan 25, 2015
123
6
I've found the problem.
There was a problem with the code I added to BaseCreature. CS

Problematic code
Code:
public override bool CanBeHarmful(IDamageable damageable, bool message, bool ignoreOurBlessedness)
        {
            Mobile target = damageable as Mobile;

            if (RecentSetControl && GetMaster() == target)
            {
                return false;
            }
           
            if ( this.Controlled && target.Playe)
            {
                return false;
            }
Modified code
Code:
public override bool CanBeHarmful(IDamageable damageable, bool message, bool ignoreOurBlessedness)
        {
            Mobile target = damageable as Mobile;

            if (RecentSetControl && GetMaster() == target)
            {
                return false;
            }
           
            if ( this.Controlled && target.Player && !Region.IsPartOf("BlackthornDungeon"))
            {
                return false;
            }