From 9f2df31db6fe5450826cc68fd2158fe218dd8000 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 19 Nov 2025 23:10:38 -0500 Subject: dungeon: inventory usage --- dungeon/src/entity.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dungeon/src/entity.rs') diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index a0750dd..9af27bd 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -337,6 +337,7 @@ pub struct Player { pub weapon: Weapon, // How long until we reset potion effects? pub potion_timer: Option, + pub active_inv_slot: usize, } impl Player { /// Instantiates the game player at a given `Pos` @@ -354,11 +355,13 @@ impl Player { let inventory = vec![]; let weapon = Weapon::RustyKnife; let potion_timer = None; + let active_inv_slot = 0; Self { entity, inventory, weapon, potion_timer, + active_inv_slot, } } } @@ -517,7 +520,7 @@ impl Dungeon { }; updater.update_entity(&mut self.player.entity); - for enemy in &mut self.enemies { + for enemy in &mut self.entities { updater.update_entity(enemy); } } -- cgit v1.2.3-freya