diff options
-rw-r--r-- | src/LuaSL/LuaSL_main.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c index 2955ca4..3ed9004 100644 --- a/src/LuaSL/LuaSL_main.c +++ b/src/LuaSL/LuaSL_main.c | |||
@@ -183,14 +183,7 @@ static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Ad | |||
183 | static void _compileCb(LuaCompiler *compiler) | 183 | static void _compileCb(LuaCompiler *compiler) |
184 | { | 184 | { |
185 | if (0 == compiler->bugCount) | 185 | if (0 == compiler->bugCount) |
186 | { | ||
187 | gameGlobals *ourGlobals = compiler->data; | ||
188 | script *me = scriptAdd(compiler->file, compiler->SID, send2server, ourGlobals); | ||
189 | |||
190 | me->client = compiler->client; | ||
191 | eina_hash_add(ourGlobals->names, me->fileName, me); | ||
192 | sendBack(compiler->client, compiler->SID, "compiled(true)"); | 186 | sendBack(compiler->client, compiler->SID, "compiled(true)"); |
193 | } | ||
194 | else | 187 | else |
195 | sendBack(compiler->client, compiler->SID, "compiled(false)"); | 188 | sendBack(compiler->client, compiler->SID, "compiled(false)"); |
196 | free(compiler->luaName); | 189 | free(compiler->luaName); |
@@ -225,7 +218,6 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
225 | { | 218 | { |
226 | char *temp; | 219 | char *temp; |
227 | char *file; | 220 | char *file; |
228 | char *name; | ||
229 | LuaSL_compiler *compiler = calloc(1, sizeof(LuaSL_compiler)); | 221 | LuaSL_compiler *compiler = calloc(1, sizeof(LuaSL_compiler)); |
230 | 222 | ||
231 | strcpy(buf, &command[8]); | 223 | strcpy(buf, &command[8]); |
@@ -235,7 +227,6 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
235 | temp++; | 227 | temp++; |
236 | temp[0] = '\0'; | 228 | temp[0] = '\0'; |
237 | 229 | ||
238 | name = &file[strlen(prefix_data_get())]; | ||
239 | compiler->compiler.file = strdup(file); | 230 | compiler->compiler.file = strdup(file); |
240 | compiler->compiler.SID = strdup(SID); | 231 | compiler->compiler.SID = strdup(SID); |
241 | compiler->compiler.client = ev->client; | 232 | compiler->compiler.client = ev->client; |
@@ -254,10 +245,22 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
254 | } | 245 | } |
255 | #endif | 246 | #endif |
256 | } | 247 | } |
257 | else if (0 == strcmp(command, "run()")) | 248 | else if (0 == strncmp(command, "run(", 4)) |
258 | { | 249 | { |
250 | char *temp; | ||
251 | char *file; | ||
259 | script *me; | 252 | script *me; |
260 | 253 | ||
254 | strcpy(buf, &command[4]); | ||
255 | temp = buf; | ||
256 | file = temp; | ||
257 | while (')' != temp[0]) | ||
258 | temp++; | ||
259 | temp[0] = '\0'; | ||
260 | me = scriptAdd(file, SID, send2server, ourGlobals); | ||
261 | |||
262 | me->client = ev->client; | ||
263 | eina_hash_add(ourGlobals->names, me->fileName, me); | ||
261 | me = getScript(SID); | 264 | me = getScript(SID); |
262 | if (me) | 265 | if (me) |
263 | { | 266 | { |