From acb264c0270d69f50fdb5c3648dad52e5fe2ad0c Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 7 Jun 2021 11:14:54 +1000 Subject: [PATCH] revert(client/main): Go back to table.insert for GetStatusData Not even sure why I did it as size+1 and not i; but doesn't seem to work with index anyway. Fixes nil value after dying --- client/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index afe7498e..b6776f64 100644 --- a/client/main.lua +++ b/client/main.lua @@ -13,19 +13,19 @@ function GetStatusData(minimal) for i=1, #Status, 1 do if minimal then - status[#status+1] = { + table.insert(status, { name = Status[i].name, val = Status[i].val, percent = (Status[i].val / Config.StatusMax) * 100 - } + }) else - status[#status+1] { + table.insert(status, { name = Status[i].name, val = Status[i].val, color = Status[i].color, visible = Status[i].visible(Status[i]), percent = (Status[i].val / Config.StatusMax) * 100 - } + }) end end