Errors on player death and respawnFixed
Hi there.

I am getting some errors today:

(10:55:46) | Failed to call hook 'OnEntityDeath' on plugin 'CorpseLocation v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.CorpseLocation.OnEntityDeath (BaseCombatEntity entity, HitInfo info) [0x0007c] in <a01c2a4342424db3b8f3e314b00aea1c>:0
at Oxide.Plugins.CorpseLocation.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x000e6] in <a01c2a4342424db3b8f3e314b00aea1c>: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
(10:55:52) | Failed to call hook 'OnPlayerRespawned' on plugin 'CorpseLocation v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.CorpseLocation.OnPlayerRespawned (BasePlayer player) [0x00000] in <a01c2a4342424db3b8f3e314b00aea1c>:0
at Oxide.Plugins.CorpseLocation.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x000b8] in <a01c2a4342424db3b8f3e314b00aea1c>: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

How odd, I can't seem to replicate that here. Could I ask to see your data file?
I deleted the old one as part of the wipe cycle, it does not appear to have created a new one, even on reload.  Should I delete my config and reload to see if that recreated the data file?  I had assumed I should remove it as part of the wipe cycle.
Are you using the newest oxide? Deleting the data file here and then reloading the plugin recreates it as it should. I'm unsure as to how to recreate the error you're getting.
In response to shinnova ():
Are you using the newest oxide? Deleting the data file here and then reloading the plugin recreates...
Looks to me like storedData.deaths is null, which should ideally have a null check to avoid this error, but also means that something likely isn't being stored right else was corrupted.
ok uloade reload got an error:

(05:34:45) | Failed to call hook 'OnServerInitialized' on plugin 'CorpseLocation v2.0.5' (MissingMethodException: Default constructor not found for type Oxide.Plugins.CorpseLocation+StoredData)

at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x0007b] in <e1a80661d61443feb3dbdaac88eeb776>:0

at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <e1a80661d61443feb3dbdaac88eeb776>:0

at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <e1a80661d61443feb3dbdaac88eeb776>:0

at System.Activator.CreateInstance[T] () [0x00015] in <e1a80661d61443feb3dbdaac88eeb776>:0

at Oxide.Core.DataFileSystem.ReadObject[T] (System.String name) [0x00009] in <4452f821def6406d834e4149849fe7ea>:0

at Oxide.Plugins.CorpseLocation.OnServerInitialized () [0x0001c] in <82df908558fd485a94173a8439fb39ab>:0

at Oxide.Plugins.CorpseLocation.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00095] in <82df908558fd485a94173a8439fb39ab>: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

(05:34:46) | Loaded plugin Corpse Location v2.0.5 by shinnova


Did a hack and placed an empty CorpseLocation.json in \data and it loads fine:
{
"deaths": {
}
}

note to self do not delete the data.
Just happened again, seems it might be picking up NPC?

(06:32:53) | Failed to call hook 'OnEntityDeath' on plugin 'CorpseLocation v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.CorpseLocation.OnEntityDeath (BaseCombatEntity entity, HitInfo info) [0x0007c] in <a3bcad12020f40a4a2b883d1de8d0a12>:0

at Oxide.Plugins.CorpseLocation.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x000e6] in <a3bcad12020f40a4a2b883d1de8d0a12>: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

(06:32:53) | 4665688[20488295/4665688] was killed by Explosion

@mspeedie Let me know if you still have this issue after the latest update!
Locked automatically