Fixed max hp not being cap for health

This commit is contained in:
Rendo 2026-04-30 22:04:32 +05:00
commit faca0cb118

View file

@ -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