From 04651fae15ffe7a5050884db69aa774e25affce3 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Sun, 5 May 2024 09:52:57 +0200 Subject: [PATCH] Prevent crash from RaidLeave failure --- Fika.Core/Coop/GameMode/CoopGame.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Fika.Core/Coop/GameMode/CoopGame.cs b/Fika.Core/Coop/GameMode/CoopGame.cs index 4dda819f..00eee33b 100644 --- a/Fika.Core/Coop/GameMode/CoopGame.cs +++ b/Fika.Core/Coop/GameMode/CoopGame.cs @@ -1374,8 +1374,15 @@ public override void Stop(string profileId, ExitStatus exitStatus, string exitNa wavesSpawnScenario_0?.Stop(); - PlayerLeftRequest body = new PlayerLeftRequest(myPlayer.ProfileId); - FikaRequestHandler.RaidLeave(body); + try + { + PlayerLeftRequest body = new(myPlayer.ProfileId); + FikaRequestHandler.RaidLeave(body); + } + catch (Exception) + { + FikaPlugin.Instance.FikaLogger.LogError("Unable to send RaidLeave request to server."); + } if (CoopHandler.TryGetCoopHandler(out CoopHandler coopHandler)) {