mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 02:50: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.Patching;
|
||||||
using Aki.Reflection.Utils;
|
using Aki.Reflection.Utils;
|
||||||
using EFT;
|
using EFT;
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
@ -42,13 +41,16 @@ namespace Aki.SinglePlayer.Patches.Quests
|
|||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
private static bool PrefixPatch(object __instance, ref ExitStatus exitStatus, ref string exitName)
|
private static bool PrefixPatch(object __instance, ref ExitStatus exitStatus, ref string exitName)
|
||||||
{
|
{
|
||||||
// No extract name and successful, its a MIA
|
var isParsed = bool.TryParse(RequestHandler.GetJson("/singleplayer/settings/raid/endstate"), out bool MIAOnRaidEnd);
|
||||||
if (string.IsNullOrEmpty(exitName?.Trim()) && exitStatus == ExitStatus.Survived)
|
if (isParsed)
|
||||||
{
|
{
|
||||||
exitStatus = ExitStatus.MissingInAction;
|
// No extract name and successful, its a MIA
|
||||||
exitName = null;
|
if (MIAOnRaidEnd == true && string.IsNullOrEmpty(exitName?.Trim()) && exitStatus == ExitStatus.Survived)
|
||||||
|
{
|
||||||
|
exitStatus = ExitStatus.MissingInAction;
|
||||||
|
exitName = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; // Do original
|
return true; // Do original
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user