From 09c42e150acf14b6c6b0a45085d1f0dd4cb2d207 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 2 Jan 2023 21:42:33 -0800 Subject: [PATCH] detach player when killing ship --- QSB/DeathSync/Patches/DeathPatches.cs | 8 +++++++- QSB/manifest.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/QSB/DeathSync/Patches/DeathPatches.cs b/QSB/DeathSync/Patches/DeathPatches.cs index b4eee646..383741a2 100644 --- a/QSB/DeathSync/Patches/DeathPatches.cs +++ b/QSB/DeathSync/Patches/DeathPatches.cs @@ -64,7 +64,7 @@ public class DeathPatches : QSBPatch [HarmonyPrefix] [HarmonyPatch(typeof(DeathManager), nameof(DeathManager.FinishDeathSequence))] - public static bool FinishDeathSequence(DeathManager __instance) + public static bool DeathManager_FinishDeathSequence(DeathManager __instance) { if (!__instance._isDead) { @@ -200,6 +200,12 @@ public class DeathPatches : QSBPatch } Locator.GetDeathManager().KillPlayer(__instance._deathType); + // detach the player before vanishing the ship so we dont delete the player too + if (PlayerAttachWatcher.Current) + { + PlayerAttachWatcher.Current.DetachPlayer(); + } + // original method returns here. we dont cuz we want to ship the get destroyed even if the player is inside it } __instance.Vanish(shipBody, entryLocation); diff --git a/QSB/manifest.json b/QSB/manifest.json index 8752c076..478a02e3 100644 --- a/QSB/manifest.json +++ b/QSB/manifest.json @@ -7,7 +7,7 @@ "body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications." }, "uniqueName": "Raicuparta.QuantumSpaceBuddies", - "version": "0.24.1", + "version": "0.24.2", "owmlVersion": "2.9.0", "dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ], "pathsToPreserve": [ "debugsettings.json" ],