summaryrefslogtreecommitdiff
path: root/src/world.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-24 12:58:43 +0100
committertroido <troido@protonmail.com>2020-02-24 12:58:43 +0100
commitf6a037faa2b675cd7318d6dd8ccee5133c89845d (patch)
tree6d94c7e84f100d0343ba8e87c03f67082405328b /src/world.rs
parent715c9106dbff4524f3fdf5d23f762e5e6518e0cb (diff)
run an update before loading an outdated room
Diffstat (limited to 'src/world.rs')
-rw-r--r--src/world.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/world.rs b/src/world.rs
index 9f86cb8..40d600a 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -47,6 +47,10 @@ impl <'a, 'b>World<'a, 'b> {
if let Ok(state) = self.persistence.load_room(id.clone()){
room.load_saved(&state);
}
+ let last_time = self.timestamp - 1;
+ if room.get_time() < last_time {
+ room.update(last_time);
+ }
self.rooms.insert(id.clone(), room);
}
self.rooms.get_mut(id).ok_or(aerr!("can't get room after loading it"))