Merge pull request #281 from misternebula/more-fixes

Fix quit issue and stop probe teleporting to player head for 1 frame
This commit is contained in:
_nebula 2021-04-18 19:25:42 +01:00 committed by GitHub
commit 27bf37242f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -6,8 +6,17 @@ namespace QSB.Player.Patches
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
public override void DoPatches() => QSBCore.HarmonyHelper.AddPrefix<PlayerCrushedController>("CrushPlayer", typeof(PlayerPatches), nameof(PlayerCrushedController_CrushPlayer));
public override void DoUnpatches() => QSBCore.HarmonyHelper.Unpatch<PlayerCrushedController>("CrushPlayer");
public override void DoPatches()
{
QSBCore.HarmonyHelper.AddPrefix<PlayerCrushedController>("CrushPlayer", typeof(PlayerPatches), nameof(PlayerCrushedController_CrushPlayer));
QSBCore.HarmonyHelper.AddPrefix<PauseMenuManager>("OnExitToMainMenu", typeof(PlayerPatches), nameof(PauseMenuManager_OnExitToMainMenu));
}
public override void DoUnpatches()
{
QSBCore.HarmonyHelper.Unpatch<PlayerCrushedController>("CrushPlayer");
QSBCore.HarmonyHelper.Unpatch<PauseMenuManager>("OnExitToMainMenu");
}
public static bool PlayerCrushedController_CrushPlayer()
{
@ -16,5 +25,11 @@ namespace QSB.Player.Patches
Locator.GetDeathManager().KillPlayer(DeathType.Crushed);
return false;
}
public static void PauseMenuManager_OnExitToMainMenu()
{
QSBPlayerManager.LocalPlayer.PlayerStates.IsReady = false;
QSBCore.HasWokenUp = false;
}
}
}

View File

@ -56,7 +56,7 @@ namespace QSB.ProbeSync.TransformSync
_disabledSocket = socket;
}
/*
protected override void UpdateTransform()
{
base.UpdateTransform();
@ -85,6 +85,7 @@ namespace QSB.ProbeSync.TransformSync
}
SyncedTransform.localPosition = ReferenceSector.Transform.InverseTransformPoint(_disabledSocket.position);
}
*/
public override bool IsReady => Locator.GetProbe() != null
&& Player != null