From aa4930169f597859524b4195f5d8ef582b375363 Mon Sep 17 00:00:00 2001 From: almightylks Date: Thu, 3 Dec 2020 13:59:12 +0100 Subject: [PATCH] Potential fix for NullReferenceException in Pocket --- EventHandler/PluginEventHandler.cs | 4 ++++ SCP-008.csproj | 16 ++++++++-------- packages.config | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/EventHandler/PluginEventHandler.cs b/EventHandler/PluginEventHandler.cs index dbc927c..6c00adf 100644 --- a/EventHandler/PluginEventHandler.cs +++ b/EventHandler/PluginEventHandler.cs @@ -51,6 +51,10 @@ private void Player_PlayerDeathEvent(PlayerDeathEventArgs ev) => infectedPlayers.Remove(ev.Victim); private void Player_PlayerDamageEvent(PlayerDamageEventArgs ev) { + //If either the killer or the victim is null (Potential damage inflicted by Server) + if (ev.Killer is null || ev.Victim is null) + return; + //If the victim inflicted dmg to themselves / SCP-008 damage tick if (ev.Killer == ev.Victim || ev.HitInfo.GetDamageType().name == "FALLDOWN") return; diff --git a/SCP-008.csproj b/SCP-008.csproj index f0f5935..96caa6d 100644 --- a/SCP-008.csproj +++ b/SCP-008.csproj @@ -35,19 +35,19 @@ ..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll - ..\packages\SynapseSL.2.1.0\lib\net472\Assembly-CSharp.dll + ..\packages\SynapseSL.2.2.0\lib\net472\Assembly-CSharp.dll - ..\packages\SynapseSL.2.1.0\lib\net472\Assembly-CSharp-firstpass.dll + ..\packages\SynapseSL.2.2.0\lib\net472\Assembly-CSharp-firstpass.dll ..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll - ..\packages\SynapseSL.2.1.0\lib\net472\Mirror.dll + ..\packages\SynapseSL.2.2.0\lib\net472\Mirror.dll - - ..\packages\SynapseSL.2.1.0\lib\net472\Synapse.dll + + ..\packages\SynapseSL.2.2.0\lib\net472\Synapse.dll @@ -59,13 +59,13 @@ - ..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.dll + ..\packages\SynapseSL.2.2.0\lib\net472\UnityEngine.dll - ..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.CoreModule.dll + ..\packages\SynapseSL.2.2.0\lib\net472\UnityEngine.CoreModule.dll - ..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.PhysicsModule.dll + ..\packages\SynapseSL.2.2.0\lib\net472\UnityEngine.PhysicsModule.dll ..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll diff --git a/packages.config b/packages.config index 0a38d28..739f278 100644 --- a/packages.config +++ b/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file