From 53fe89764f8f679f3f4cbaa39c2393918898815f Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 5 Feb 2012 16:38:50 +1000 Subject: Implement the script main loop, and the script UUID, which we call SID, though for now it's only the file name. --- LuaSL/src/LuaSL_compile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'LuaSL/src/LuaSL_compile.c') diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 80eda62..4821589 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -2276,8 +2276,10 @@ boolean compileLSL(gameGlobals *game, char *script, boolean doConstants) fprintf(out, "--// Generated code goes here.\n\n"); fprintf(out, "local _bit = require(\"bit\")\n"); fprintf(out, "local _LSL = require(\"LSL\")\n\n"); + // TODO - Use the scripts UUID instead of the file name here. + fprintf(out, "local _SID = [=[%s]=]\n\n", compiler.fileName); outputLeaf(out, OM_LUA, compiler.ast); - fprintf(out, "\n\n_LSL.mainLoop(_defaultState)\n"); // This actually starts the script running. + fprintf(out, "\n\n_LSL.mainLoop(_SID, _defaultState)\n"); // This actually starts the script running. fprintf(out, "\n--// End of generated code.\n\n"); fclose(out); -- cgit v1.1