fix(core): resolve review findings in Sprint 3-4

- Fix SaveManager reset_game to use DirAccess.remove correctly
- Add null check for FileAccess.open in save_game
- Fix AudioManager crossfade tween callback chain
- Replace fragile absolute HUD path with relative onready
- Guard character position save against empty id
- Add GameState.has_character_position helper
- Emit room_changed signal after tween completes
- Add target_floor validation in ElevatorButton
- Persist audio settings via GameState
- Add class_name to RoomNavigator, AudioManager, HUD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Steven Wroblewski
2026-04-17 12:22:27 +02:00
parent 13db45bb04
commit 6b0c41bbfd
9 changed files with 36 additions and 14 deletions

View File

@@ -12,6 +12,7 @@ func save_game() -> void:
var data: Dictionary = GameState.get_save_data()
var file: FileAccess = FileAccess.open(SAVE_PATH, FileAccess.WRITE)
if file == null:
push_error("SaveManager: cannot open save file for writing")
return
file.store_string(JSON.stringify(data))
file.close()
@@ -32,7 +33,9 @@ func load_game() -> void:
func reset_game() -> void:
if FileAccess.file_exists(SAVE_PATH):
DirAccess.remove_absolute(SAVE_PATH)
var dir: DirAccess = DirAccess.open("user://")
if dir != null:
dir.remove("savegame.json")
GameState.apply_save_data({})