[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. */
|
||||
buf = pack_readfile(DATA, filename, &bufsize);
|
||||
if(luaL_dobuffer(L, buf, bufsize, filename) != 0) {
|
||||
ERR("loading AI file: %s", filename);
|
||||
ERR("%s", lua_tostring(L, -1));
|
||||
WARN("Most likely Lua file has improper syntax, please check it.");
|
||||
ERR("Error loading AI file: %s\n"
|
||||
"%s\n"
|
||||
"Most likely Lua file has improper syntax, please check.",
|
||||
filename, lua_tostring(L, -1));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -384,9 +384,10 @@ static int music_luaInit(void) {
|
||||
/* Load the actual lua music code. */
|
||||
buf = pack_readfile(DATA, MUSIC_LUA_PATH, &bufsize);
|
||||
if(luaL_dobuffer(music_lua, buf, bufsize, MUSIC_LUA_PATH) != 0) {
|
||||
ERR("Error loading music file: %s" MUSIC_LUA_PATH);
|
||||
ERR("%s", lua_tostring(music_lua, -1));
|
||||
WARN("Most likely lua file has improper syntax, please check");
|
||||
ERR("Error loading music file: %s\n"
|
||||
"%s\n"
|
||||
"Most likely Lua file has improper syntax, please check",
|
||||
MUSIC_LUA_PATH, lua_tostring(music_lua, -1));
|
||||
return -1;
|
||||
}
|
||||
free(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user