evtl fix crash bei tot

This commit is contained in:
hydrant
2020-08-02 21:13:34 +02:00
parent cc38bb8402
commit d7e679a81c
2 changed files with 21 additions and 4 deletions

View File

@@ -9,11 +9,19 @@ namespace ReallifeGamemode.Server.Wanted
{
public static void Check_AutoWanted(Player killerPlayer, Player copPlayer)
{
User killer = killerPlayer.GetUser();
User killer = killerPlayer?.GetUser();
if (killer == null)
{
return;
}
if (killer.FactionId == 1 || killer.FactionId == 3)
return;
User cop = copPlayer.GetUser();
User cop = copPlayer?.GetUser();
if (cop == null)
{
return;
}
if (!cop.GetData<bool>("duty")) return;
if (cop.FactionId == 1 || cop.FactionId == 3)
{