diff --git a/src/game.rs b/src/game.rs index 40edfc3..30a95a6 100644 --- a/src/game.rs +++ b/src/game.rs @@ -349,8 +349,11 @@ impl Game { // a room has tiles, so handle before room for tile in &game.tiles { - let new_id = self.add_tile(tile.clone()); - insert_if_different(tile_id_changes.borrow_mut(), tile.id.clone(), new_id); + insert_if_different( + tile_id_changes.borrow_mut(), + tile.id.clone(), + self.add_tile(tile.clone()) + ); } for variable in &game.variables { @@ -386,8 +389,11 @@ impl Game { // an ending lives in a room, so handle endings before rooms for ending in &game.endings { - let new_id = self.add_ending(ending.clone()); - insert_if_different(ending_id_changes.borrow_mut(), ending.id.clone(), new_id); + insert_if_different( + ending_id_changes.borrow_mut(), + ending.id.clone(), + self.add_ending(ending.clone()) + ); } // an item has a dialogue ID, so we need to handle these after dialogues