diff --git a/data/lua/wml/modify_unit.lua b/data/lua/wml/modify_unit.lua index 54bb7a6e464..52abe0e6309 100644 --- a/data/lua/wml/modify_unit.lua +++ b/data/lua/wml/modify_unit.lua @@ -182,7 +182,8 @@ local function simple_modify_unit(cfg) -- by default always do an advancement here (not only when experience/max_experience/type was modified) -- for compatibility with old code. - if cfg.experience or cfg.max_experience or cfg.rebuild ~= false then + -- Skip for recall list units + if u.valid == 'map' and (cfg.experience or cfg.max_experience or cfg.rebuild ~= false) then u:advance() end end diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 49a52c8a690..ba796e758fe 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -3276,7 +3276,6 @@ static int intf_remove_modifications(lua_State *L) static int intf_advance_unit(lua_State *L) { events::command_disabler command_disabler; - //TODO: check whether the unit is on the map. unit& u = luaW_checkunit(L, 1, true); advance_unit_params par(u.get_location()); if(lua_isboolean(L, 2)) {