mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Removed potential for divide by zero
This commit is contained in:
parent
0c19679406
commit
ade466a12b
@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Admins can now grant normal players plots to place blocks within
|
||||
- Diamonds are now much more than twice as expensive as twigs.
|
||||
- Permission to build is no longer tied to being an admin
|
||||
- Seperated character randomization buttons into appearance and name.
|
||||
- Separated character randomization buttons into appearance and name.
|
||||
- Reworked mindflayer to have unique attacks
|
||||
|
||||
### Removed
|
||||
|
@ -132,7 +132,7 @@ impl Health {
|
||||
}
|
||||
|
||||
/// Returns the fraction of health an entity has remaining
|
||||
pub fn fraction(&self) -> f32 { self.current as f32 / self.maximum as f32 }
|
||||
pub fn fraction(&self) -> f32 { self.current as f32 / self.maximum.max(1) as f32 }
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
|
Loading…
Reference in New Issue
Block a user