From 72a0b772128adb6fd8bef318cb28d8a5c3e03839 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 3 Jul 2021 09:52:00 +0200 Subject: [PATCH] fix: put the stats in an internal list It'll allow us later to even drop the internal list and replace it by automatic computation --- sonic-radiance.love/game/abstractmobs/statmanager.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sonic-radiance.love/game/abstractmobs/statmanager.lua b/sonic-radiance.love/game/abstractmobs/statmanager.lua index 105180d..4c19330 100644 --- a/sonic-radiance.love/game/abstractmobs/statmanager.lua +++ b/sonic-radiance.love/game/abstractmobs/statmanager.lua @@ -16,8 +16,9 @@ function StatManager:new(owner) end function StatManager:setStats(stats) + self.list = {} for key, value in pairs(stats) do - self[key] = value + self.list[key] = value end end @@ -26,7 +27,7 @@ function StatManager:get(statname) end function StatManager:computeStat(statname) - return self[statname] + return self.list[statname] end return StatManager \ No newline at end of file