[Fix] More Lua stack balancing.
This commit is contained in:
parent
04ed5fe1bc
commit
00384adf7b
@ -88,6 +88,8 @@ static int factionL_createmetatable(lua_State* L, int readonly) {
|
||||
/* Register the values. */
|
||||
luaL_register(L, NULL, (readonly) ? faction_methods_cond : faction_methods);
|
||||
|
||||
lua_pop(L, 1);
|
||||
|
||||
return 0; /* No error. */
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,8 @@ static int misn_runTopStack(Mission* misn, char* func) {
|
||||
cur_mission = misn;
|
||||
misn_delete = 0;
|
||||
|
||||
if((ret = lua_pcall(misn->L, 0, 0, 0))) {
|
||||
ret = lua_pcall(misn->L, 0, 0, 0);
|
||||
if(ret != 0) { /* Error has occured. */
|
||||
/* Did an oops. */
|
||||
err = (lua_isstring(misn->L, -1)) ? (char*) lua_tostring(misn->L, -1) : NULL;
|
||||
if(strcmp(err, "Mission Done")!=0)
|
||||
|
@ -124,6 +124,9 @@ static int planetL_createmetatable(lua_State* L) {
|
||||
/* Register the values. */
|
||||
luaL_register(L, NULL, planet_methods);
|
||||
|
||||
/* Clean up. */
|
||||
lua_pop(L, 1);
|
||||
|
||||
return 0; /* No error. */
|
||||
}
|
||||
|
||||
@ -143,6 +146,9 @@ static int systemL_createmetatable(lua_State* L) {
|
||||
/* Register the values. */
|
||||
luaL_register(L, NULL, system_methods);
|
||||
|
||||
/* Clean up. */
|
||||
lua_pop(L, 1);
|
||||
|
||||
return 0; /* No error. */
|
||||
}
|
||||
|
||||
@ -162,6 +168,9 @@ static int vectorL_createmetatable(lua_State* L) {
|
||||
/* Register the values. */
|
||||
luaL_register(L, NULL, vector_methods);
|
||||
|
||||
/* Clean up. */
|
||||
lua_pop(L, 1);
|
||||
|
||||
return 0; /* No error. */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user