From 64f75f6f832c8133d015eb202b8451685844bea7 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Thu, 2 Jul 2020 15:03:50 +0100 Subject: [PATCH] tidyup --- src/game.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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