From 037dbf242b1c5c25b4077c0ad3fabd3dcb701949 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Mon, 14 Oct 2024 23:44:04 -0700 Subject: [PATCH] FIX: Interior sky and water are not mutually exclusive --- src/game_object.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/game_object.rs b/src/game_object.rs index cb26e92..e7b0a18 100644 --- a/src/game_object.rs +++ b/src/game_object.rs @@ -129,12 +129,16 @@ pub fn book(entity_props: &HashMap<&String, &String>, ref_id: &str, mesh_name: & pub fn cell(entity_props: &HashMap<&String, &String>, ref_id: &str) -> Cell { let mut flags = CellFlags::default() | CellFlags::IS_INTERIOR; + if let Ok(_) = get_prop("FakeExterior", entity_props).parse::() { + flags |= CellFlags::BEHAVES_LIKE_EXTERIOR; + } + if let Ok(_) = get_prop("HasWater", entity_props).parse::() { - flags |= CellFlags::HAS_WATER - } else if let Ok(_) = get_prop("FakeExterior", entity_props).parse::() { - flags |= CellFlags::BEHAVES_LIKE_EXTERIOR - } else if let Ok(_) = get_prop("RestIsIllegal", entity_props).parse::() { - flags |= CellFlags::RESTING_IS_ILLEGAL + flags |= CellFlags::HAS_WATER; + }; + + if let Ok(_) = get_prop("RestIsIllegal", entity_props).parse::() { + flags |= CellFlags::RESTING_IS_ILLEGAL; }; Cell {