Skip to content

Commit

Permalink
Merge pull request #592 from misternebula/dev
Browse files Browse the repository at this point in the history
0.24.2
  • Loading branch information
JohnCorby authored Jan 9, 2023
2 parents 5f8f468 + b0a1bf0 commit d97b781
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
39 changes: 38 additions & 1 deletion QSB/DeathSync/Patches/DeathPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static bool HighSpeedImpactSensor_HandlePlayerInsideShip(HighSpeedImpactS

[HarmonyPrefix]
[HarmonyPatch(typeof(DeathManager), nameof(DeathManager.FinishDeathSequence))]
public static bool FinishDeathSequence(DeathManager __instance)
public static bool DeathManager_FinishDeathSequence(DeathManager __instance)
{
if (!__instance._isDead)
{
Expand Down Expand Up @@ -200,10 +200,47 @@ public static bool DestructionVolume_VanishShip(DestructionVolume __instance, OW
}

Locator.GetDeathManager().KillPlayer(__instance._deathType);
// detach the player before vanishing so we dont deactivate the player too
if (PlayerAttachWatcher.Current)
{
PlayerAttachWatcher.Current.DetachPlayer();
}
// original method returns here. we dont cuz we want to ship to get deactivated even if the player is inside it
}

__instance.Vanish(shipBody, entryLocation);
GlobalMessenger.FireEvent("ShipDestroyed");
return false;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(DestructionVolume), nameof(DestructionVolume.VanishShipCockpit))]
public static bool DestructionVolume_VanishShipCockpit(DestructionVolume __instance, OWRigidbody shipCockpitBody, RelativeLocationData entryLocation)
{
if (PlayerState.AtFlightConsole())
{
Locator.GetDeathManager().KillPlayer(__instance._deathType);
// detach the player before vanishing so we dont deactivate the player too
if (PlayerAttachWatcher.Current)
{
PlayerAttachWatcher.Current.DetachPlayer();
}
// original method returns here. we dont cuz we want to ship cockpit to get deactivated even if the player is inside it
}
__instance.Vanish(shipCockpitBody, entryLocation);
return false;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(DestructionVolume), nameof(DestructionVolume.VanishNomaiShuttle))]
public static bool DestructionVolume_VanishNomaiShuttle(DestructionVolume __instance, OWRigidbody shuttleBody, RelativeLocationData entryLocation)
{
if (shuttleBody.GetComponentInChildren<NomaiShuttleController>().IsPlayerInside())
{
Locator.GetDeathManager().KillPlayer(__instance._deathType);
// original method returns here. we dont cuz we want to nomai shuttle to get deactivated even if the player is inside it
}
__instance.Vanish(shuttleBody, entryLocation);
return false;
}
}
2 changes: 1 addition & 1 deletion QSB/DeathSync/RespawnOnDeath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private void ResetSuitState()

private void ResetCloak()
{
if (EntitlementsManager.IsDlcOwned() != EntitlementsManager.AsyncOwnershipStatus.Owned)
if (QSBCore.DLCInstalled)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion QSB/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" ],
Expand Down

0 comments on commit d97b781

Please sign in to comment.