fix: floor hp and pp
This commit is contained in:
parent
fbcf352a51
commit
053c9ca641
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue