diff --git a/Fika.Core/Coop/Components/CoopHandler.cs b/Fika.Core/Coop/Components/CoopHandler.cs index 728c6f29..2abe947f 100644 --- a/Fika.Core/Coop/Components/CoopHandler.cs +++ b/Fika.Core/Coop/Components/CoopHandler.cs @@ -197,18 +197,21 @@ void ProcessQuitting() if (FikaPlugin.ExtractKey.Value.IsDown() && quitState != EQuitState.NONE && !requestQuitGame) { requestQuitGame = true; + CoopGame coopGame = (CoopGame)Singleton.Instance; // If you are the server / host if (MatchmakerAcceptPatches.IsServer) { - // A host needs to wait for the team to extract or die! - if ((Singleton.Instance.NetServer.ConnectedPeersCount > 0) && quitState != EQuitState.NONE) + // A host needs to wait for the team to extract or die! + if ((Singleton.Instance.NetServer.ConnectedPeersCount > 0) && quitState != EQuitState.NONE) { NotificationManagerClass.DisplayWarningNotification("HOSTING: You cannot exit the game until all clients have disconnected."); requestQuitGame = false; return; } - else if (Singleton.Instance.NetServer.ConnectedPeersCount == 0 && Singleton.Instance.timeSinceLastPeerDisconnected > DateTime.Now.AddSeconds(-5) && Singleton.Instance.hasHadPeer) + else if (Singleton.Instance.NetServer.ConnectedPeersCount == 0 + && Singleton.Instance.timeSinceLastPeerDisconnected > DateTime.Now.AddSeconds(-5) + && Singleton.Instance.hasHadPeer) { NotificationManagerClass.DisplayWarningNotification($"HOSTING: Please wait at least 5 seconds after the last peer disconnected before quitting."); requestQuitGame = false; @@ -216,16 +219,12 @@ void ProcessQuitting() } else { - Singleton.Instance.Stop(Singleton.Instance.MainPlayer.ProfileId, - Singleton.Instance.MyExitStatus, - MyPlayer.ActiveHealthController.IsAlive ? Singleton.Instance.MyExitLocation : null, 0); + coopGame.Stop(Singleton.Instance.MainPlayer.ProfileId, coopGame.MyExitStatus, MyPlayer.ActiveHealthController.IsAlive ? coopGame.MyExitLocation : null, 0); } } else { - Singleton.Instance.Stop(Singleton.Instance.MainPlayer.ProfileId, - Singleton.Instance.MyExitStatus, - MyPlayer.ActiveHealthController.IsAlive ? Singleton.Instance.MyExitLocation : null, 0); + coopGame.Stop(Singleton.Instance.MainPlayer.ProfileId, coopGame.MyExitStatus, MyPlayer.ActiveHealthController.IsAlive ? coopGame.MyExitLocation : null, 0); } return; } diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index 9bc84bc6..587875dd 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -1466,11 +1466,18 @@ public void Extract(CoopPlayer player, ExfiltrationPoint point) { PreloaderUI preloaderUI = Singleton.Instance; - if (MyExitStatus == ExitStatus.MissingInAction) + + if (MyExitStatus == ExitStatus.MissingInAction) { NotificationManagerClass.DisplayMessageNotification("You have gone missing in action...", iconType: EFT.Communications.ENotificationIconType.Alert, textColor: Color.red); } + BackendConfigSettingsClass.GClass1361.GClass1367 matchEndConfig = Singleton.Instance.Experience.MatchEnd; + if (player.Profile.EftStats.SessionCounters.GetAllInt([CounterTag.Exp]) < matchEndConfig.SurvivedExpRequirement || PastTime < matchEndConfig.SurvivedTimeRequirement) + { + MyExitStatus = ExitStatus.Runner; + } + if (point != null) { point.Disable(); @@ -1635,7 +1642,7 @@ private IEnumerator SaveOnDeathRoutine() public override void Stop(string profileId, ExitStatus exitStatus, string exitName, float delay = 0f) { - Logger.LogInfo("CoopGame::Stop"); + Logger.LogDebug("CoopGame::Stop"); CoopPlayer myPlayer = (CoopPlayer)Singleton.Instance.MainPlayer; myPlayer.PacketSender.DestroyThis();