From 4f7ceda998c861203397fb9857421a6db25536fd Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Tue, 25 Aug 2026 16:44:34 +0200 Subject: [PATCH] fix evader --- Patches/ShipStatusPatch.cs | 44 +++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/Patches/ShipStatusPatch.cs b/Patches/ShipStatusPatch.cs index c046de15b..251027929 100644 --- a/Patches/ShipStatusPatch.cs +++ b/Patches/ShipStatusPatch.cs @@ -231,36 +231,40 @@ internal static class UpdateSystemPatch } } - if (ShipStatusSystem.AllSabotage.Contains(systemType) && !Utils.IsActive(systemType)) + // LateTask is needed because 2-part sabotages such as O2 aren't immediately deactivated when both consoles are completed, only after the next FixedUpdate + LateTask.New(() => { - bool petcd = !Options.UsePhantomBasis.GetBool(); - - List pcs = Main.CachedAlivePlayerControls(); - - for (var index = 0; index < pcs.Count; index++) + if (ShipStatusSystem.AllSabotage.Contains(systemType) && !Utils.IsActive(systemType)) { - PlayerControl pc = pcs[index]; + bool petcd = !Options.UsePhantomBasis.GetBool(); - try + List pcs = Main.CachedAlivePlayerControls(); + + for (var index = 0; index < pcs.Count; index++) { - switch (pc.GetCustomRole()) + PlayerControl pc = pcs[index]; + + try { - case CustomRoles.Wiper: + switch (pc.GetCustomRole()) { - if (petcd) pc.AddAbilityCD(); - else pc.RpcResetAbilityCooldown(); - break; - } - case CustomRoles.Evader: - { - pc.RpcMakeVisible(); - break; + case CustomRoles.Wiper: + { + if (petcd) pc.AddAbilityCD(); + else pc.RpcResetAbilityCooldown(); + break; + } + case CustomRoles.Evader: + { + pc.RpcMakeVisible(); + break; + } } } + catch (Exception e) { Utils.ThrowException(e); } } - catch (Exception e) { Utils.ThrowException(e); } } - } + }, 0.1f); } public static void CheckAndOpenDoorsRange(ShipStatus __instance, int amount, int min, int max)