1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need help, IDamageableItem Crash.

Discussion in 'Script Support' started by 13440130, Mar 12, 2019.

  1. 13440130
    Online

    13440130 Member

    Joined:
    Jan 25, 2015
    Messages:
    103
    Likes Received:
    5
    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.
     
  2. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    4,093
    Likes Received:
    451
    This would be the Lighthouse in ServUO with no changes made? If so I can send this to bug reports
     
  3. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    1,123
    Likes Received:
    160
    Agree. If you mean the InvasionBeacon, it is configured as "DamageableItem" not "IDamageableItem" which might be a problem if "CanBeHarmful" needs that.
     
    • Agree Agree x 1
  4. 13440130
    Online

    13440130 Member

    Joined:
    Jan 25, 2015
    Messages:
    103
    Likes Received:
    5
    I've found the problem.
    There was a problem with the code I added to BaseCreature. CS

    Problematic code
    Code (C#):
    1. public override bool CanBeHarmful(IDamageable damageable, bool message, bool ignoreOurBlessedness)
    2.         {
    3.             Mobile target = damageable as Mobile;
    4.  
    5.             if (RecentSetControl && GetMaster() == target)
    6.             {
    7.                 return false;
    8.             }
    9.            
    10.             if ( this.Controlled && target.Playe)
    11.             {
    12.                 return false;
    13.             }
    Modified code
    Code (C#):
    1. public override bool CanBeHarmful(IDamageable damageable, bool message, bool ignoreOurBlessedness)
    2.         {
    3.             Mobile target = damageable as Mobile;
    4.  
    5.             if (RecentSetControl && GetMaster() == target)
    6.             {
    7.                 return false;
    8.             }
    9.            
    10.             if ( this.Controlled && target.Player && !Region.IsPartOf("BlackthornDungeon"))
    11.             {
    12.                 return false;
    13.             }
     
Similar Threads: need help
Forum Title Date
ServUO Discussion Need help getting started Dec 9, 2018
Mono Support Need help with email registration Dec 6, 2018
Script Support Need some help with a potential script issue. Oct 24, 2018
Script Support I need to turn of the Pet Trainer Helper Sep 20, 2018
Script Support Need a little help again. Sep 18, 2018
Script Support Need Alittle help Sep 6, 2018
General Discussion New RunUO user needs help Sep 4, 2018