0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 03:30:44 -05:00

Fix null error when looking for bots id in enemies list - check key object instead of value

Set result to true and don't perform original function, no need
This commit is contained in:
Dev 2023-07-17 13:09:55 +01:00
parent de3ad49ecb
commit c1ff106a16

View File

@ -50,9 +50,11 @@ namespace Aki.Custom.Patches
}
// Check existing enemies list
if (!__instance.Enemies.IsNullOrEmpty() && __instance.Enemies.Any(x=> x.Value.Player.Id == requester.Id))
// Could also check x.Value.Player?.Id - BSG do it this way
if (!__instance.Enemies.IsNullOrEmpty() && __instance.Enemies.Any(x=> x.Key.Id == requester.Id))
{
isEnemy = true;
__result = true;
return true;
}
else
{