mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 12:32:55 +00:00
detach player when killing ship
This commit is contained in:
parent
e838dc391d
commit
09c42e150a
@ -64,7 +64,7 @@ public class DeathPatches : QSBPatch
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(DeathManager), nameof(DeathManager.FinishDeathSequence))]
|
[HarmonyPatch(typeof(DeathManager), nameof(DeathManager.FinishDeathSequence))]
|
||||||
public static bool FinishDeathSequence(DeathManager __instance)
|
public static bool DeathManager_FinishDeathSequence(DeathManager __instance)
|
||||||
{
|
{
|
||||||
if (!__instance._isDead)
|
if (!__instance._isDead)
|
||||||
{
|
{
|
||||||
@ -200,6 +200,12 @@ public class DeathPatches : QSBPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
Locator.GetDeathManager().KillPlayer(__instance._deathType);
|
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);
|
__instance.Vanish(shipBody, entryLocation);
|
||||||
|
@ -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."
|
"body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications."
|
||||||
},
|
},
|
||||||
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
|
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
|
||||||
"version": "0.24.1",
|
"version": "0.24.2",
|
||||||
"owmlVersion": "2.9.0",
|
"owmlVersion": "2.9.0",
|
||||||
"dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ],
|
"dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ],
|
||||||
"pathsToPreserve": [ "debugsettings.json" ],
|
"pathsToPreserve": [ "debugsettings.json" ],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user