mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-16 18:31:32 +00:00
Avoided redundant test and cleaned the stack.
This commit is contained in:
parent
4d0c03eac2
commit
12df7c16f1
@ -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 (;;)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user