From 43eab974b07e29658c68a1844ac0ac6ecfb97b47 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 24 Apr 2021 16:39:36 -0400 Subject: [PATCH] fix access --- src/items.rs | 6 +++--- src/player.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/items.rs b/src/items.rs index 87d979e..a541098 100644 --- a/src/items.rs +++ b/src/items.rs @@ -12,8 +12,8 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct StunGun { - range: f32, - duration: f64 + pub range: f32, + pub duration: f64 } #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] @@ -24,5 +24,5 @@ pub struct Flashlight; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct Flippers { - speed_increase: f32 + pub speed_increase: f32 } \ No newline at end of file diff --git a/src/player.rs b/src/player.rs index afdd68c..6562a32 100644 --- a/src/player.rs +++ b/src/player.rs @@ -79,7 +79,7 @@ impl Player { /// Try to attack with the stun gun pub fn begin_attack(&mut self) { if true || self.inventory.stun_gun.is_some() && self.stun_timer == 0.0 { - self.attacking_timer = STUN_ATTACK_TIME; + self.attacking_timer = self.inventory.stun_gun.as_ref().unwrap().duration; } }