NullReferenceException at OnEntityTakeDamageFixed

 hello how can i solve this problem?
That happens when I attack the tank.
happens when I use c4

 

Failed to call hook 'OnEntityTakeDamage' on plugin 'RustNotifications v0.9.2' 
(NullReferenceException: Object reference not set to an instance of an object) at 
Oxide.Plugins.RustNotifications.OnEntityTakeDamage (BaseCombatEntity entity, HitInfo info) 
[0x0005b] in :0 at Oxide.Plugins.RustNotifications.DirectCallHook (System.String name, 
System.Object& ret, System.Object[] args) [0x002c6] in :0 at 
Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] 
args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 at 
Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in
 <4452f821def6406d834e4149849fe7ea>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String 
hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 00:07 [Error] 
Failed to call hook 'OnEntityTakeDamage' on plugin 'RustNotifications v0.9.2' 
(NullReferenceException: Object reference not set to an instance of an object) at 
Oxide.Plugins.RustNotifications.OnEntityTakeDamage (BaseCombatEntity entity, HitInfo info) 
[0x0005b] in :0 at Oxide.Plugins.RustNotifications.DirectCallHook (System.String name, 
System.Object& ret, System.Object[] args) [0x002c6] in :0 at 
Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[]
 args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 at 
Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in 
<4452f821def6406d834e4149849fe7ea>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String 
hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0​


Merged post

hello?

Merged post

i have found the bug !!!
search on row 45 

        BasePlayer player = info.InitiatorPlayer;

            ulong hitEntityOwnerID = entity.OwnerID != 0 ? entity.OwnerID : info.HitEntity.OwnerID;

            if (hitEntityOwnerID == 0)
            {
                return;
            }

and replace it with

            BasePlayer player = info.InitiatorPlayer;

            ulong hitEntityOwnerID = entity.OwnerID != null ? entity.OwnerID : info.HitEntity.OwnerID;

            if (hitEntityOwnerID == null)
            {
                return;
            }​
In response to Hawker ():
 hello how can i solve this problem?
That happens when I attack the tank.
happens when I u...
then you get that in the console if someone destroys an object with c4 which belongs in no one

Tried to find player with ID {0} but they weren't in active or sleeping player list
00:00 [Error] Failed to call hook 'OnEntityTakeDamage' on plugin 'RustNotifications v0.9.2' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.RustNotifications.OnEntityTakeDamage (BaseCombatEntity entity, HitInfo info) [0x0005b] in <6278027c893b4ebd9b028b008b55ad1d>:0
  at Oxide.Plugins.RustNotifications.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x002c6] in <6278027c893b4ebd9b028b008b55ad1d>:0
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
you must edit 1 thing in the plugin

search
ulong hitEntityOwnerID = entity.OwnerID != 0 ? entity.OwnerID : info.HitEntity.OwnerID;

replace it with
ulong hitEntityOwnerID = entity.OwnerID != null ? entity.OwnerID : info.HitEntity.OwnerID;
I believe this is actually cvaused by info.HitEntity being null. A fix has been applied in the last update.
Locked automatically