Save game on level start if enabled

This commit is contained in:
Marco 2025-04-02 18:39:37 +02:00
commit 3d4ed2a1fd
2 changed files with 7 additions and 2 deletions

View file

@ -69,6 +69,11 @@ public partial class GameManager : Node2D
{
Instance = this;
if (GlobalState.Instance.SessionSettings.AllowSaving)
{
GlobalState.Instance.SaveGame();
}
_hud = GetNodeOrNull<Hud>("HUD");
if (_hud == null) GD.Print("No HUD in scene.");
@ -189,10 +194,8 @@ public partial class GameManager : Node2D
_player.Owner = this;
}
_player.Transform = this.GlobalTransform;
_player.GlobalPosition = GetStartPosition();
LastCheckpointPosition = _player.GlobalPosition;