Skip to content

Commit

Permalink
Potential fix for NullReferenceException in Pocket
Browse files Browse the repository at this point in the history
  • Loading branch information
almightylks committed Dec 3, 2020
1 parent 313d132 commit aa49301
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions EventHandler/PluginEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions SCP-008.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
<HintPath>..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Assembly-CSharp.dll</HintPath>
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="LiteDB, Version=5.0.9.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Mirror.dll</HintPath>
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\Mirror.dll</HintPath>
</Reference>
<Reference Include="Synapse, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Synapse.dll</HintPath>
<Reference Include="Synapse, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\Synapse.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -59,13 +59,13 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.dll</HintPath>
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
<HintPath>..\packages\SynapseSL.2.2.0\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="Lib.Harmony" version="2.0.4" targetFramework="net472" />
<package id="LiteDB" version="5.0.9" targetFramework="net472" />
<package id="SynapseSL" version="2.1.0" targetFramework="net472" />
<package id="SynapseSL" version="2.2.0" targetFramework="net472" />
<package id="YamlDotNet" version="8.1.2" targetFramework="net472" />
</packages>

0 comments on commit aa49301

Please sign in to comment.