From d8ce66ace0af0c05665745117a4c3d7050074082 Mon Sep 17 00:00:00 2001 From: Sunrunner37 Date: Tue, 3 Mar 2020 20:09:36 -0800 Subject: [PATCH] Force a game quit when pushing quit. This is a temporary measure to unblock our release which has several outstanding stateful bugs associated with previous game data persisting after disconnect. --- NitroxPatcher/Patches/Dynamic/IngameMenu_QuitGame_Patch.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NitroxPatcher/Patches/Dynamic/IngameMenu_QuitGame_Patch.cs b/NitroxPatcher/Patches/Dynamic/IngameMenu_QuitGame_Patch.cs index 4eb5e76d3d..a4f3da4a99 100644 --- a/NitroxPatcher/Patches/Dynamic/IngameMenu_QuitGame_Patch.cs +++ b/NitroxPatcher/Patches/Dynamic/IngameMenu_QuitGame_Patch.cs @@ -3,6 +3,7 @@ using Harmony; using NitroxClient.Communication.Abstract; using NitroxModel.Core; +using UnityEngine; namespace NitroxPatcher.Patches.Dynamic { @@ -13,8 +14,9 @@ public class IngameMenu_QuitGame_Patch : NitroxPatch, IDynamicPatch public static void Prefix() { - IMultiplayerSession multiplayerSession = NitroxServiceLocator.LocateService(); + IMultiplayerSession multiplayerSession = NitroxServiceLocator.LocateService(); multiplayerSession.Disconnect(); + Application.Quit(); } public override void Patch(HarmonyInstance harmony)