fix: correction du statholder

This commit is contained in:
Kazhnuz 2024-08-07 19:57:11 +02:00
parent 9a6eb606c0
commit c5d6deee85

View file

@ -13,6 +13,7 @@ end
function StatHolder:reduce(level) function StatHolder:reduce(level)
local stat = self.commands.base + ((self.commands.lvl or 0) * level) + (self.commands.add or 0) + (self.commands.bonus or 0) local stat = self.commands.base + ((self.commands.lvl or 0) * level) + (self.commands.add or 0) + (self.commands.bonus or 0)
local modulo = commands.structs[self.key].modulo or 1 local modulo = commands.structs[self.key].modulo or 1
datas = commands.structs[self.key]
stat = math.floor(stat / modulo) * modulo stat = math.floor(stat / modulo) * modulo
stat = math.min(stat, datas.max or 999999) stat = math.min(stat, datas.max or 999999)
stat = math.max(stat, datas.min or -99999) stat = math.max(stat, datas.min or -99999)