Lua: Make sure unit type is built before returning it from iteration

Fixes #8456
This commit is contained in:
Celtic Minstrel 2024-02-25 11:32:01 -05:00 committed by Celtic Minstrel
parent 9371562454
commit 04b5315b0b

View file

@ -176,6 +176,10 @@ static int impl_unit_type_next(lua_State* L)
}
lua_pushlstring(L, it->first.c_str(), it->first.size());
luaW_pushunittype(L, it->second);
if(!base) {
// Make sure the unit is built.
unit_types.build_unit_type(it->second, unit_type::FULL);
}
return 2;
}