summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-03-05 18:42:43 +0100
committertroido <troido@protonmail.com>2020-03-05 18:42:43 +0100
commit3332e38616db5a2d785fde69e8c82f20364d2b4e (patch)
tree50c86da1a26ef2f7f09dd7617a75e234c027795d /src
parent74e1707722325f9c97b42c56fb710744528b11f1 (diff)
print any failures in room loading to stdout
Diffstat (limited to 'src')
-rw-r--r--src/world.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/world.rs b/src/world.rs
index 16ac4db..7b02d90 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -43,6 +43,14 @@ impl <'a, 'b>World<'a, 'b> {
}
fn get_room_mut(&mut self, id: &RoomId) -> Result<&mut Room<'a, 'b>> {
+ let result = self.get_room_mut_(id);
+ if let Err(err) = &result {
+ println!("Failed to load room {:?}: {:?}", id, err);
+ }
+ result
+ }
+
+ fn get_room_mut_(&mut self, id: &RoomId) -> Result<&mut Room<'a, 'b>> {
if !self.rooms.contains_key(id){
let template = self.template_loader.load_room(id.clone())?;
let mut room: Room = Room::create(id.clone(), &self.encyclopedia, &template);