From 1826d93467341dec9947e0592bc1e9b7deddcf51 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 30 Mar 2014 15:39:03 +1000 Subject: Fix up using aliases in Stufflets, plus it helps if the alias is in the right call. lol --- ClientHamr/GuiLua/skang.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ClientHamr/GuiLua/skang.lua') diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index a742845..e0123fb 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua @@ -479,10 +479,15 @@ Thing.__newindex = function (module, key, value) local valueMeta if 'table' == type(value) then -- Coz setting it via modThing screws with the __index stuff somehow. - valueMeta = getmetatable(modThing.__values[name]) - if valueMeta then - for k, v in pairs(value) do - valueMeta.__values[k] = v + local oldValue = modThing.__values[name] + if 'table' == type(oldValue) then + valueMeta = getmetatable(oldValue) + if valueMeta then + for k, v in pairs(value) do + local newK = valueMeta.__stuff[k] + if newK then newK = newK.names[1] else newK = k end + valueMeta.__values[newK] = v + end end end end -- cgit v1.1