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 f07373c commit d0775f8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
18 changes: 9 additions & 9 deletions AdvancedDoctorPlus.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 All @@ -77,7 +77,7 @@
<Compile Include="Config\PluginConfig.cs" />
<Compile Include="Config\SCP049Healing.cs" />
<Compile Include="Config\SCP049ZombieStorm.cs" />
<Compile Include="DoctorStats.cs" />
<Compile Include="Helper\DoctorStats.cs" />
<Compile Include="EventHandler\PluginEventHandler.cs" />
<Compile Include="Helper\Helper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
4 changes: 4 additions & 0 deletions EventHandler/PluginEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ private void Round_RoundEndEvent()

private void Player_PlayerDeathEvent(PlayerDeathEventArgs 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 (ev.Victim.RoleType == RoleType.Scp049)
Doctors.RemoveWhere((_) => _.Player == ev.Victim);

Expand Down
2 changes: 1 addition & 1 deletion DoctorStats.cs → Helper/DoctorStats.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Synapse.Api;

namespace AdvancedDoctorPlus
namespace AdvancedDoctorPlus.Helper
{
public class DoctorStats
{
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 d0775f8

Please sign in to comment.