diff options
| -rw-r--r-- | src/world.rs | 8 | ||||
| -rw-r--r-- | todo.md | 5 |
2 files changed, 10 insertions, 3 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); @@ -1,13 +1,12 @@ # TODO +- save equipment +- save time - save variable arguments (health etc) - timer resource -- safely write files -- log failure in room loading - log world events to player - draw new entities -- equipment - room unloading - relative room locations - shortcuts for defining items |
