NullReferenceException at OnNpcTargetFixed
Not sure it's causing any specific issues, but I have what seem like hundreds of log entries about it.
00:32 [Error] Failed to call hook 'OnNpcTarget' on plugin 'NeutralAnimals v1.0.6' (NullReferenceException: Object reference not set to an instance of an object.)
  at Oxide.Plugins.NeutralAnimals.OnNpcTarget (BaseAnimalNPC animal, BaseEntity entity) [0x0001e] in <81b6025706ff457699a62f48f7743933>:0 
  at Oxide.Plugins.NeutralAnimals.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00052] in <81b6025706ff457699a62f48f7743933>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <d09a1f46ca2f4432811bcfe45ad13c7b>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <cf88a28c7fb44d36890d85a78331cc9d>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <cf88a28c7fb44d36890d85a78331cc9d>:0​
I think I've found the issue, check fo the latest update
0x89A
I think I've found the issue, check fo the latest update

Thanks!

It appears the error still occurs. Here's what I get

03:15 [Error] Failed to call hook 'OnNpcTarget' on plugin 'NeutralAnimals v1.0.7' (NullReferenceException: Object reference not set to an instance of an object.)
  at Oxide.Plugins.NeutralAnimals.OnNpcTarget (BaseAnimalNPC animal, BaseEntity entity) [0x0002d] in <0848be5ffee9402498d389f04a93947b>:0 
  at Oxide.Plugins.NeutralAnimals.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00052] in <0848be5ffee9402498d389f04a93947b>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <d09a1f46ca2f4432811bcfe45ad13c7b>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <cf88a28c7fb44d36890d85a78331cc9d>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <cf88a28c7fb44d36890d85a78331cc9d>:0 ​
Ok thanks for this I'll look into it when I have time. 
0x89A
Ok thanks for this I'll look into it when I have time. 
entity.net.connection is likely null, should null check that before checking permission.
            if (entity.IsNpc || animal.lastAttacker == null || entity.net.connection != null && !permission.UserHasPermission(entity.net.connection.userid.ToString(), canuse) || (animal.lastAttacker == entity && (Time.time - animal.lastAttackedTime) < _config.forgetTime)) return null;
            else return true;
If the 2nd arg is only intended to be players, that could be converted to BasePlayer as well.

Also, a description attribute should be added:
[Info("Neutral Animals", "0x89A", "1.0.8")]
[Description("Animals only attack if they are attacked first")]​
5e13a8d5b2bc5.jpg Wulf
entity.net.connection is likely null, should null check that before checking permission.
            if (entity.IsNpc || animal.lastAttacker == null || entity.net.connection != null && !permission.UserHasPermission(entity.net.connection.userid.ToString(), canuse) || (animal.lastAttacker == entity && (Time.time - animal.lastAttackedTime) < _config.forgetTime)) return null;
            else return true;
If the 2nd arg is only intended to be players, that could be converted to BasePlayer as well.

Also, a description attribute should be added:
[Info("Neutral Animals", "0x89A", "1.0.8")]
[Description("Animals only attack if they are attacked first")]​
Cheers Wulf, not at my pc rn but I'll update this when I next get on. 
Locked automatically