From f0aa3d1d081a7468a5b078ae40c35dc15c067d47 Mon Sep 17 00:00:00 2001 From: Condorra Date: Mon, 29 Jan 2024 21:54:42 +1100 Subject: [PATCH] Minor bugfix: doors shouldn't swing shut if they are already closed. --- blastmud_game/src/message_handler/user_commands/open.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/blastmud_game/src/message_handler/user_commands/open.rs b/blastmud_game/src/message_handler/user_commands/open.rs index 29aaded6..7d3b3716 100644 --- a/blastmud_game/src/message_handler/user_commands/open.rs +++ b/blastmud_game/src/message_handler/user_commands/open.rs @@ -64,10 +64,8 @@ impl TaskHandler for SwingShutHandler { .as_mut() .and_then(|ds| ds.get_mut(&direction)) { - None => { - return Ok(None); - } - Some(v) => v, + Some(v) if v.open => v, + _ => return Ok(None), }; (*door_state).open = false; ctx.trans.save_item_model(&room_item_mut).await?;