From 55172401dd9ffcbc6b051703d57200821439f1d0 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 7 Aug 2024 07:20:34 +0200 Subject: [PATCH] feat(statholder): ajout des valeurs mins/max --- classes/dataholders/statholder.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/dataholders/statholder.lua b/classes/dataholders/statholder.lua index fa38979..4fe1573 100644 --- a/classes/dataholders/statholder.lua +++ b/classes/dataholders/statholder.lua @@ -14,6 +14,8 @@ 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 modulo = commands.structs[self.key].modulo or 1 stat = math.floor(stat / modulo) * modulo + stat = math.min(stat, datas.max or 999999) + stat = math.max(stat, datas.min or -99999) return stat end