diff options
author | David Walter Seikel | 2014-03-22 18:01:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-03-22 18:01:23 +1000 |
commit | c13ada054617f6ebceffc80dfea61cd820c216a3 (patch) | |
tree | 1f4fa85c2d37c38d678845f7be2d51a0015aeeed | |
parent | Actually check if we need to return Thing default, and return it. (diff) | |
download | SledjHamr-c13ada054617f6ebceffc80dfea61cd820c216a3.zip SledjHamr-c13ada054617f6ebceffc80dfea61cd820c216a3.tar.gz SledjHamr-c13ada054617f6ebceffc80dfea61cd820c216a3.tar.bz2 SledjHamr-c13ada054617f6ebceffc80dfea61cd820c216a3.tar.xz |
Test and fix setting nil on a Thing with a default.
-rw-r--r-- | ClientHamr/GuiLua/skang.lua | 2 | ||||
-rw-r--r-- | ClientHamr/GuiLua/test.lua | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index 327dc38..c0c63dc 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua | |||
@@ -184,7 +184,7 @@ Thing = | |||
184 | print(thing.module._NAME .. '.' .. name .. '(' .. types .. ') -> ' .. thing.help) | 184 | print(thing.module._NAME .. '.' .. name .. '(' .. types .. ') -> ' .. thing.help) |
185 | else | 185 | else |
186 | thing:isValid() | 186 | thing:isValid() |
187 | print(thing.types[1] .. ' ' .. thing.module._NAME .. '.' .. name .. ' = ' .. value .. ' -> ' .. thing.help) | 187 | print(thing.types[1] .. ' ' .. thing.module._NAME .. '.' .. name .. ' = ' .. (value or 'nil') .. ' -> ' .. thing.help) |
188 | -- TODO - Go through it's linked things and set them to. | 188 | -- TODO - Go through it's linked things and set them to. |
189 | end | 189 | end |
190 | rawset(table, name, value) | 190 | rawset(table, name, value) |
diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua index 6c48ca6..c1aeb7c 100644 --- a/ClientHamr/GuiLua/test.lua +++ b/ClientHamr/GuiLua/test.lua | |||
@@ -52,3 +52,9 @@ test.ffunc('one', 2) | |||
52 | --skang.things.ffunc('seven', 'aight') | 52 | --skang.things.ffunc('seven', 'aight') |
53 | test.f = 42 | 53 | test.f = 42 |
54 | print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help) | 54 | print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help) |
55 | test.f = nil | ||
56 | print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help) | ||
57 | test.fooble = 42 | ||
58 | print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help) | ||
59 | test.fooble = nil | ||
60 | print('f is now ' .. test.fooble .. ' ' .. test.f .. ' ' .. skang.things.f.help .. ' ' .. skang.things.fooble.help) | ||