Instead of killing player just freeze

This commit is contained in:
Nick 2022-08-29 22:37:12 -04:00
parent 192c22733c
commit 0b1325ab85

View File

@ -647,6 +647,13 @@ namespace NewHorizons
#region Change star system
public void ChangeCurrentStarSystem(string newStarSystem, bool warp = false, bool vessel = false)
{
// If we're just on the title screen set the system for later
if (LoadManager.GetCurrentScene() == OWScene.TitleScreen)
{
_currentStarSystem = newStarSystem;
return;
}
if (IsChangingStarSystem) return;
IsWarpingFromShip = warp;
@ -658,9 +665,6 @@ namespace NewHorizons
IsChangingStarSystem = true;
WearingSuit = PlayerState.IsWearingSuit();
// We kill them so they don't move as much
Locator.GetDeathManager().KillPlayer(DeathType.Meditation);
OWScene sceneToLoad;
if (newStarSystem == "EyeOfTheUniverse")
@ -678,12 +682,15 @@ namespace NewHorizons
_currentStarSystem = newStarSystem;
// Freeze player inputs
OWInput.ChangeInputMode(InputMode.None);
LoadManager.LoadSceneAsync(sceneToLoad, !vessel, LoadManager.FadeType.ToBlack, 0.1f, true);
}
void OnDeath(DeathType _)
{
// We reset the solar system on death (unless we just killed the player)
// We reset the solar system on death
if (!IsChangingStarSystem)
{
// If the override is a valid system then we go there