mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 20:50:44 -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:
parent
b4b191d6b7
commit
6a490d0528
@ -33,26 +33,27 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
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
|
||||
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 (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
|
||||
{
|
||||
player.Loyalty.method_1(killedPlayer);
|
||||
player.Loyalty.method_1(killedBot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user