From 4978d263f136bff76c57a550b037b7c2866c1235 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Thu, 2 Jul 2020 15:04:21 +0100 Subject: [PATCH] refactor (will this help?) --- src/game.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game.rs b/src/game.rs index 30a95a6..7a6600e 100644 --- a/src/game.rs +++ b/src/game.rs @@ -509,8 +509,9 @@ impl Game { if sprite.room_id.is_some() { let key = sprite.room_id.clone().unwrap(); - if room_id_changes.contains_key(&key) { - sprite.room_id = Some(room_id_changes.get(&key).unwrap().clone()); + let change = room_id_changes.get(&key); + if change.is_some() { + sprite.room_id = Some(change.unwrap().clone()); } }