fix(items): safe cast in _try_return_to_chest, typed chest state param, object_states reset

- Replace unsafe direct cast in HoldableItem._try_return_to_chest() with guarded as-cast
- Type set_chest_state() parameter as Array[String] to match RoomChest._get_spawned_ids()
- Add else-branch in apply_save_data() to reset _object_states when key absent
- Rename test_save_data_has_version_two to test_save_data_has_version_three
This commit is contained in:
Steven Wroblewski
2026-05-09 01:12:29 +02:00
parent 96ec053331
commit 87db92955a
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ func test_apply_save_data_restores_held_items() -> void:
assert_eq(_state.get_character_held_item("kitten_f", "left"), "gel_tube")
func test_save_data_has_version_two() -> void:
func test_save_data_has_version_three() -> void:
var data: Dictionary = _state.get_save_data()
assert_eq(data.get("version", 0), 3)