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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user