mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 02:10:45 -05:00
Added functionality to allow player to not go missing in raid after extract timer hits 0 using server config MIAOnRaidEnd (!15)
Co-authored-by: Kaeno <e> Reviewed-on: SPT-AKI/Modules#15 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
8bef9700e2
commit
95639b9d03
@ -2,7 +2,6 @@ using Aki.Common.Http;
|
||||
using Aki.Reflection.Patching;
|
||||
using Aki.Reflection.Utils;
|
||||
using EFT;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
@ -42,13 +41,16 @@ namespace Aki.SinglePlayer.Patches.Quests
|
||||
[PatchPrefix]
|
||||
private static bool PrefixPatch(object __instance, ref ExitStatus exitStatus, ref string exitName)
|
||||
{
|
||||
// No extract name and successful, its a MIA
|
||||
if (string.IsNullOrEmpty(exitName?.Trim()) && exitStatus == ExitStatus.Survived)
|
||||
var isParsed = bool.TryParse(RequestHandler.GetJson("/singleplayer/settings/raid/endstate"), out bool MIAOnRaidEnd);
|
||||
if (isParsed)
|
||||
{
|
||||
exitStatus = ExitStatus.MissingInAction;
|
||||
exitName = null;
|
||||
// No extract name and successful, its a MIA
|
||||
if (MIAOnRaidEnd == true && string.IsNullOrEmpty(exitName?.Trim()) && exitStatus == ExitStatus.Survived)
|
||||
{
|
||||
exitStatus = ExitStatus.MissingInAction;
|
||||
exitName = null;
|
||||
}
|
||||
}
|
||||
|
||||
return true; // Do original
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user