aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-22 05:43:11 +1000
committerDavid Walter Seikel2012-02-22 05:43:11 +1000
commit8dffe12c4e80e3d58e7825530632880214ed04cd (patch)
treef34a7a1f44185af600c05eaf79a400c14d5f2411 /LuaSL/src/LuaSL_compile.c
parentFix up the EOF fix up, and commentry++. (diff)
downloadSledjHamr-8dffe12c4e80e3d58e7825530632880214ed04cd.zip
SledjHamr-8dffe12c4e80e3d58e7825530632880214ed04cd.tar.gz
SledjHamr-8dffe12c4e80e3d58e7825530632880214ed04cd.tar.bz2
SledjHamr-8dffe12c4e80e3d58e7825530632880214ed04cd.tar.xz
Implement llGetScriptName().
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_compile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 873e6c4..de103b7 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -2275,13 +2275,18 @@ boolean compileLSL(gameGlobals *game, Ecore_Con_Client *client, char *SID, char
2275 { 2275 {
2276 lua_State *L; 2276 lua_State *L;
2277 int err; 2277 int err;
2278 char *ext;
2278 2279
2279 fprintf(out, "--// Generated code goes here.\n\n"); 2280 fprintf(out, "--// Generated code goes here.\n\n");
2280 fprintf(out, "local _bit = require(\"bit\")\n"); 2281 fprintf(out, "local _bit = require(\"bit\")\n");
2281 fprintf(out, "local _LSL = require(\"LSL\")\n\n"); 2282 fprintf(out, "local _LSL = require(\"LSL\")\n\n");
2282 fprintf(out, "local _SID = [=[%s]=]\n\n", compiler.SID); 2283 fprintf(out, "local _SID = [=[%s]=]\n\n", compiler.SID);
2284 strcpy(buffer, basename(compiler.fileName));
2285 if ((ext = rindex(buffer, '.')))
2286 ext[0] = '\0';
2287 fprintf(out, "local _scriptName = [=[%s]=]\n\n", buffer);
2283 outputLeaf(out, OM_LUA, compiler.ast); 2288 outputLeaf(out, OM_LUA, compiler.ast);
2284 fprintf(out, "\n\n_LSL.mainLoop(_SID, _defaultState)\n"); // This actually starts the script running. 2289 fprintf(out, "\n\n_LSL.mainLoop(_SID, _scriptName, _defaultState)\n"); // This actually starts the script running.
2285 fprintf(out, "\n--// End of generated code.\n\n"); 2290 fprintf(out, "\n--// End of generated code.\n\n");
2286 fclose(out); 2291 fclose(out);
2287 2292