Minor bugfix: doors shouldn't swing shut if they are already closed.

This commit is contained in:
Condorra 2024-01-29 21:54:42 +11:00
parent d1a5a4d2fa
commit f0aa3d1d08

View File

@ -64,10 +64,8 @@ impl TaskHandler for SwingShutHandler {
.as_mut() .as_mut()
.and_then(|ds| ds.get_mut(&direction)) .and_then(|ds| ds.get_mut(&direction))
{ {
None => { Some(v) if v.open => v,
return Ok(None); _ => return Ok(None),
}
Some(v) => v,
}; };
(*door_state).open = false; (*door_state).open = false;
ctx.trans.save_item_model(&room_item_mut).await?; ctx.trans.save_item_model(&room_item_mut).await?;