summaryrefslogtreecommitdiff
path: root/src/game.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-08-27 03:33:50 -0500
committertom barrett <spalf0@gmail.com>2019-08-27 03:33:50 -0500
commit0f85752b1657e7b8024fb2715578712295979b3a (patch)
treed336db48ae288d08f23f89a56d01b9fa097c3a52 /src/game.rs
parentebf13bcd8e8ab799c56961e6bc1779bd8031a8dc (diff)
cargo update and dialogbox now disappears and npc resumes wandering
Diffstat (limited to 'src/game.rs')
-rw-r--r--src/game.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game.rs b/src/game.rs
index 2eabcb2..8e86b99 100644
--- a/src/game.rs
+++ b/src/game.rs
@@ -35,6 +35,11 @@ impl EventHandler for Game {
fn update(&mut self, _context: &mut Context) -> GameResult {
self.world.update();
self.camera.give_center(self.world.player.get_position());
+
+ if !self.world.player_in_talking_range() {
+ self.dialogbox.give_dialogtree(None);
+ }
+
self.dialogbox.update();
Ok(())
}