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;
|
type Output = u32;
|
||||||
|
|
||||||
fn add(self, rhs: u32) -> Self::Output {
|
fn add(self, rhs: u32) -> Self::Output {
|
||||||
if u32::MAX - self.health < rhs {
|
if self.max_health - self.health < rhs {
|
||||||
u32::MAX
|
self.max_health
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self.health + rhs
|
self.health + rhs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue