[Fix] Bug introduced by assert in WARN/ERR change.
This commit is contained in:
parent
95c9cef39c
commit
5ddb5fff94
7
src/ai.c
7
src/ai.c
@ -296,9 +296,10 @@ static int ai_loadProfile(char* filename) {
|
|||||||
/* Now load the file, since all the functions have been previously loaded. */
|
/* Now load the file, since all the functions have been previously loaded. */
|
||||||
buf = pack_readfile(DATA, filename, &bufsize);
|
buf = pack_readfile(DATA, filename, &bufsize);
|
||||||
if(luaL_dobuffer(L, buf, bufsize, filename) != 0) {
|
if(luaL_dobuffer(L, buf, bufsize, filename) != 0) {
|
||||||
ERR("loading AI file: %s", filename);
|
ERR("Error loading AI file: %s\n"
|
||||||
ERR("%s", lua_tostring(L, -1));
|
"%s\n"
|
||||||
WARN("Most likely Lua file has improper syntax, please check it.");
|
"Most likely Lua file has improper syntax, please check.",
|
||||||
|
filename, lua_tostring(L, -1));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,9 +384,10 @@ static int music_luaInit(void) {
|
|||||||
/* Load the actual lua music code. */
|
/* Load the actual lua music code. */
|
||||||
buf = pack_readfile(DATA, MUSIC_LUA_PATH, &bufsize);
|
buf = pack_readfile(DATA, MUSIC_LUA_PATH, &bufsize);
|
||||||
if(luaL_dobuffer(music_lua, buf, bufsize, MUSIC_LUA_PATH) != 0) {
|
if(luaL_dobuffer(music_lua, buf, bufsize, MUSIC_LUA_PATH) != 0) {
|
||||||
ERR("Error loading music file: %s" MUSIC_LUA_PATH);
|
ERR("Error loading music file: %s\n"
|
||||||
ERR("%s", lua_tostring(music_lua, -1));
|
"%s\n"
|
||||||
WARN("Most likely lua file has improper syntax, please check");
|
"Most likely Lua file has improper syntax, please check",
|
||||||
|
MUSIC_LUA_PATH, lua_tostring(music_lua, -1));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user