summaryrefslogtreecommitdiff
path: root/src/playerstate.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/playerstate.rs')
-rw-r--r--src/playerstate.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/playerstate.rs b/src/playerstate.rs
index c7b5f8c..9d84e5c 100644
--- a/src/playerstate.rs
+++ b/src/playerstate.rs
@@ -105,14 +105,14 @@ impl PlayerState {
inventory: items,
health: val.get("health").ok_or(aerr!("player json does not have health"))?.as_i64().ok_or(aerr!("player health not a number"))?,
inventory_capacity: inventory.get("capacity").ok_or(aerr!("inventory does no have capacity"))?.as_i64().ok_or(aerr!("inventory capacity not a number"))? as usize,
- maximum_health: val.get("maxhealth").ok_or(aerr!("player json does not have maxhealth"))?.as_i64().ok_or(aerr!("maxhealh not a number"))?
+ maximum_health: val.get("maxhealth").ok_or(aerr!("player json does not have maxhealth"))?.as_i64().ok_or(aerr!("maxhealth not a number"))?
})
}
pub fn respawn(&mut self) {
self.room = None;
self.pos = RoomPos::Unknown;
- self.health = self.maximum_health;
+ self.health = self.maximum_health / 2;
}
pub fn construct(&self, encyclopedia: &Encyclopedia) -> PreEntity {