Avoided redundant test and cleaned the stack.

This commit is contained in:
Guillaume Melquiond 2010-08-29 13:24:08 +00:00
parent 4d0c03eac2
commit 12df7c16f1

View File

@ -2983,16 +2983,12 @@ void LuaKernel::save_game(config &cfg)
if (!luaW_getglobal(L, "wesnoth", "game_events", "on_save", NULL))
return;
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
return;
}
if (!luaW_pcall(L, 0, 1, false))
return;
config v;
if (!luaW_toconfig(L, -1, cfg))
return;
luaW_toconfig(L, -1, v);
lua_pop(L, 1);
for (;;)
{