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

Renamed Variables to hopefully improve reading. Check role instead of side to tell if they are PMCs. (!145)

Renamed a few things to make it easier to read. Use role instead of side to know if they are pmcs. Cant test since one of patches fail due to remapping should be ok

Reviewed-on: SPT/Modules#145
Co-authored-by: Kaeno <kaeno@noreply.dev.sp-tarkov.com>
Co-committed-by: Kaeno <kaeno@noreply.dev.sp-tarkov.com>
This commit is contained in:
Kaeno 2024-07-05 07:42:11 +00:00 committed by chomp
parent b4b191d6b7
commit 6a490d0528

View File

@ -33,26 +33,27 @@ namespace SPT.SinglePlayer.Patches.ScavMode
return; return;
} }
if (Singleton<GameWorld>.Instance.GetEverExistedPlayerByID(playerProfileId) is Player killedPlayer) if (Singleton<GameWorld>.Instance.GetEverExistedPlayerByID(playerProfileId) is Player killedBot)
{ {
__state = new Tuple<Player, bool>(killedPlayer, killedPlayer.AIData.IsAI); __state = new Tuple<Player, bool>(killedBot, killedBot.AIData.IsAI);
var killedPlayerSettings = killedBot.Profile.Info.Settings;
// Extra check to ensure we only set playerscavs to IsAI = false // Extra check to ensure we only set playerscavs to IsAI = false
if (killedPlayer.Profile.Info.Settings.Role == WildSpawnType.assault && killedPlayer.Profile.Nickname.Contains("(")) if (killedPlayerSettings.Role == WildSpawnType.assault && killedBot.Profile.Nickname.Contains("("))
{ {
killedPlayer.AIData.IsAI = false; killedBot.AIData.IsAI = false;
} }
// If Victim is a PMC and has killed a Scav or Marksman. // If Victim is a PMC and has killed a Scav or Marksman.
if (killedPlayer.Side == EPlayerSide.Bear || killedPlayer.Side == EPlayerSide.Usec) if (killedPlayerSettings.Role == WildSpawnType.pmcBEAR || killedPlayerSettings.Role == WildSpawnType.pmcUSEC)
{ {
if(HasBotKilledScav(killedPlayer)) if (HasBotKilledScav(killedBot))
{ {
player.Profile.FenceInfo.AddStanding(killedPlayer.Profile.Info.Settings.StandingForKill, EFT.Counters.EFenceStandingSource.ScavHelp); player.Profile.FenceInfo.AddStanding(killedPlayerSettings.StandingForKill, EFT.Counters.EFenceStandingSource.ScavHelp);
} }
} }
else else
{ {
player.Loyalty.method_1(killedPlayer); player.Loyalty.method_1(killedBot);
} }
} }
} }