Fixed max hp not being cap for health
This commit is contained in:
parent
3e3fd85acc
commit
faca0cb118
1 changed files with 2 additions and 2 deletions
|
|
@ -29,8 +29,8 @@ impl Add<u32> for Health {
|
|||
type Output = u32;
|
||||
|
||||
fn add(self, rhs: u32) -> Self::Output {
|
||||
if u32::MAX - self.health < rhs {
|
||||
u32::MAX
|
||||
if self.max_health - self.health < rhs {
|
||||
self.max_health
|
||||
}
|
||||
else {
|
||||
self.health + rhs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue