summaryrefslogtreecommitdiff
path: root/src/world.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.rs')
-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);