aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LSL.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-04 22:47:37 +1000
committerDavid Walter Seikel2012-02-04 22:47:37 +1000
commit6b097d337444a0e02efc6cebed08a860d2e435ed (patch)
treeb923c45c8f71068d3acc705d813a794a44cff030 /LuaSL/src/LSL.lua
parentSet variables to a proper value if otherwised unitialized. (diff)
downloadSledjHamr-6b097d337444a0e02efc6cebed08a860d2e435ed.zip
SledjHamr-6b097d337444a0e02efc6cebed08a860d2e435ed.tar.gz
SledjHamr-6b097d337444a0e02efc6cebed08a860d2e435ed.tar.bz2
SledjHamr-6b097d337444a0e02efc6cebed08a860d2e435ed.tar.xz
Implement typecasts when needed. Actually, doing some extras for the moment.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LSL.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index cc9b454..1e7cc13 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -311,6 +311,38 @@ function LSL.stateChange(x)
311 end 311 end
312end; 312end;
313 313
314function LSL.floatTypecast(x)
315 local temp = tonumber(x)
316 if nil == temp then temp = 0 end
317 return temp;
318end
319
320function LSL.integerTypecast(x)
321 local temp = tonumber(x)
322 if nil == temp then temp = 0 end
323 return temp;
324end
325
326function LSL.keyTypecast(x)
327 return "" .. x;
328end
329
330function LSL.listTypecast(x)
331 return {x};
332end
333
334function LSL.rotationTypecast(x)
335 return x;
336end
337
338function LSL.stringTypecast(x)
339 return "" .. x;
340end
341
342function LSL.vectorTypecast(x)
343 return x;
344end
345
314 346
315return LSL; 347return LSL;
316 348