This commit is contained in:
Max Bradbury 2020-07-02 15:03:50 +01:00
parent 12b6d1904e
commit 64f75f6f83
1 changed files with 10 additions and 4 deletions

View File

@ -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