0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00

Fixes to scav extracts. Now allowing correct extracts as we were disabling some incorrectly

This commit is contained in:
Kaeno 2024-01-18 14:19:58 +00:00
parent a5c2e1a0a4
commit b89af9f1ee

View File

@ -3,6 +3,8 @@ using Comfort.Common;
using EFT; using EFT;
using System.Reflection; using System.Reflection;
using HarmonyLib; using HarmonyLib;
using EFT.Interactive;
using System.Linq;
namespace Aki.SinglePlayer.Patches.ScavMode namespace Aki.SinglePlayer.Patches.ScavMode
{ {
@ -32,12 +34,25 @@ namespace Aki.SinglePlayer.Patches.ScavMode
// Only disable PMC extracts if current player is a scav // Only disable PMC extracts if current player is a scav
if (player.Fraction == ETagStatus.Scav && player.Location != "hideout") if (player.Fraction == ETagStatus.Scav && player.Location != "hideout")
{ {
// these are PMC extracts only, scav extracts are under a different field called ScavExfiltrationPoints
foreach (var exfil in gameWorld.ExfiltrationController.ExfiltrationPoints) foreach (var exfil in gameWorld.ExfiltrationController.ExfiltrationPoints)
{
if (exfil is ScavExfiltrationPoint scavExfil)
{
// We are checking if player exists in list so we dont disable the wrong extract
if(!scavExfil.EligibleIds.Contains(player.ProfileId))
{ {
exfil.Disable(); exfil.Disable();
} }
} }
else
{
// Disabling extracts that aren't scav extracts
exfil.Disable();
// _authorityToChangeStatusExternally Changing this to false stop buttons from re-enabling extracts (d-2 extract, zb-013)
exfil.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance).First(x => x.Name == "_authorityToChangeStatusExternally").SetValue(exfil, false);
}
}
}
} }
} }
} }