Lua: Make sure unit type is built before returning it from iteration
Fixes #8456
This commit is contained in:
parent
9371562454
commit
04b5315b0b
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue