fix: floor hp and pp

This commit is contained in:
Kazhnuz 2020-08-07 07:32:16 +02:00
parent fbcf352a51
commit 053c9ca641

View file

@ -47,7 +47,7 @@ function AbstractMobParent:setHP(newHP, relative)
else else
self.hp = newHP self.hp = newHP
end end
self.hp = math.max(0, self.hp) self.hp = math.floor(math.max(0, self.hp))
end end
function AbstractMobParent:setPP(newPP, relative) function AbstractMobParent:setPP(newPP, relative)
@ -56,6 +56,7 @@ function AbstractMobParent:setPP(newPP, relative)
else else
self.pp = newPP self.pp = newPP
end end
self.pp = math.floor(math.max(0, self.pp))
end end
function AbstractMobParent:isAlive() function AbstractMobParent:isAlive()