mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Make compiled lua load again (#80)
This commit is contained in:
parent
0b8370eacb
commit
dc02aa9881
1 changed files with 2 additions and 2 deletions
|
|
@ -210,7 +210,7 @@ static void smlua_load_script(struct Mod* mod, struct ModFile* file, u16 remoteI
|
||||||
|
|
||||||
f_seek(f, 0, SEEK_END);
|
f_seek(f, 0, SEEK_END);
|
||||||
size_t length = f_tell(f);
|
size_t length = f_tell(f);
|
||||||
char *buffer = calloc(length + 1, 1);
|
void *buffer = calloc(length + 1, 1);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
LOG_LUA("Failed to load lua script '%s': Cannot allocate buffer.", file->cachedPath);
|
LOG_LUA("Failed to load lua script '%s': Cannot allocate buffer.", file->cachedPath);
|
||||||
gLuaInitializingScript = 0;
|
gLuaInitializingScript = 0;
|
||||||
|
|
@ -226,7 +226,7 @@ static void smlua_load_script(struct Mod* mod, struct ModFile* file, u16 remoteI
|
||||||
f_close(f);
|
f_close(f);
|
||||||
f_delete(f);
|
f_delete(f);
|
||||||
|
|
||||||
if (luaL_loadstring(L, buffer) != LUA_OK) { // only run on success
|
if (luaL_loadbuffer(L, buffer, length, file->cachedPath) != LUA_OK) { // only run on success
|
||||||
LOG_LUA("Failed to load lua script '%s'.", file->cachedPath);
|
LOG_LUA("Failed to load lua script '%s'.", file->cachedPath);
|
||||||
LOG_LUA("%s", smlua_to_string(L, lua_gettop(L)));
|
LOG_LUA("%s", smlua_to_string(L, lua_gettop(L)));
|
||||||
gLuaInitializingScript = 0;
|
gLuaInitializingScript = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue