From f8eb2374cbd7bbeb7199354a383cf50726d7c218 Mon Sep 17 00:00:00 2001 From: dwesterwick Date: Sat, 17 Aug 2024 07:05:43 +0000 Subject: [PATCH] IsEnemyPatch Improvements (Part 3) (!158) Added null check to new `ContainsPlayer` helper method from !157 Reviewed-on: https://dev.sp-tarkov.com/SPT/Modules/pulls/158 Co-authored-by: dwesterwick Co-committed-by: dwesterwick --- project/SPT.Custom/CustomAI/AiHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/SPT.Custom/CustomAI/AiHelpers.cs b/project/SPT.Custom/CustomAI/AiHelpers.cs index fc99a2b..b824488 100644 --- a/project/SPT.Custom/CustomAI/AiHelpers.cs +++ b/project/SPT.Custom/CustomAI/AiHelpers.cs @@ -74,7 +74,7 @@ namespace SPT.Custom.CustomAI foreach (IPlayer player in players) { - if (player.Id == playerToCheck.Id) + if (player != null && player.Id == playerToCheck.Id) { return true; }