diff options
author | David Walter Seikel | 2012-02-12 00:06:44 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-12 00:06:44 +1000 |
commit | 13c0366d3865bfd8830c5851c66ec834c2e83aba (patch) | |
tree | 7636e415b032e13fe131d2e880a0f047cb61ac9a /LuaSL | |
parent | Measure compile speed the right way. lol (diff) | |
download | SledjHamr-13c0366d3865bfd8830c5851c66ec834c2e83aba.zip SledjHamr-13c0366d3865bfd8830c5851c66ec834c2e83aba.tar.gz SledjHamr-13c0366d3865bfd8830c5851c66ec834c2e83aba.tar.bz2 SledjHamr-13c0366d3865bfd8830c5851c66ec834c2e83aba.tar.xz |
SID is now full path to the LSL file. Still need to change it to the UUID of the running script.
Diffstat (limited to 'LuaSL')
-rw-r--r-- | LuaSL/src/LSL.lua | 5 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua index c2e4d1c..7a47a69 100644 --- a/LuaSL/src/LSL.lua +++ b/LuaSL/src/LSL.lua | |||
@@ -567,12 +567,11 @@ function LSL.stateChange(x) | |||
567 | end | 567 | end |
568 | end; | 568 | end; |
569 | 569 | ||
570 | function LSL.mainLoop(ourSID, x) | 570 | function LSL.mainLoop(sid, x) |
571 | local sid = ourSID .. ".events" | ||
572 | local status, errorMsg = luaproc.newchannel(sid) | 571 | local status, errorMsg = luaproc.newchannel(sid) |
573 | local result | 572 | local result |
574 | 573 | ||
575 | SID = ourSID | 574 | SID = sid |
576 | 575 | ||
577 | if not status then | 576 | if not status then |
578 | msg("Can't open the luaproc channel " .. sid .. " ERROR MESSAGE: " .. errorMsg) | 577 | msg("Can't open the luaproc channel " .. sid .. " ERROR MESSAGE: " .. errorMsg) |
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 805f26e..95761a2 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -2275,7 +2275,7 @@ boolean compileLSL(gameGlobals *game, char *script, boolean doConstants) | |||
2275 | fprintf(out, "local _bit = require(\"bit\")\n"); | 2275 | fprintf(out, "local _bit = require(\"bit\")\n"); |
2276 | fprintf(out, "local _LSL = require(\"LSL\")\n\n"); | 2276 | fprintf(out, "local _LSL = require(\"LSL\")\n\n"); |
2277 | // TODO - Use the scripts UUID instead of the file name here, or something. | 2277 | // TODO - Use the scripts UUID instead of the file name here, or something. |
2278 | fprintf(out, "local _SID = [=[%s.lua.out]=]\n\n", compiler.fileName); | 2278 | fprintf(out, "local _SID = [=[%s]=]\n\n", compiler.fileName); |
2279 | outputLeaf(out, OM_LUA, compiler.ast); | 2279 | outputLeaf(out, OM_LUA, compiler.ast); |
2280 | fprintf(out, "\n\n_LSL.mainLoop(_SID, _defaultState)\n"); // This actually starts the script running. | 2280 | fprintf(out, "\n\n_LSL.mainLoop(_SID, _defaultState)\n"); // This actually starts the script running. |
2281 | fprintf(out, "\n--// End of generated code.\n\n"); | 2281 | fprintf(out, "\n--// End of generated code.\n\n"); |