Set last_item_value properly for complex enums

develop
lethosor 2018-04-09 16:11:47 -04:00
parent c1dd21730d
commit 7da8793172
3 changed files with 8 additions and 1 deletions

@ -152,6 +152,7 @@ enum_identity::enum_identity(size_t size,
{
if (complex) {
count = complex->size();
last_item_value = complex->index_value_map.back();
}
else {
count = int(last_item_value-first_item_value+1);

@ -1451,6 +1451,12 @@ static void FillEnumKeys(lua_State *state, int ix_meta, int ftable, enum_identit
lua_pushlightuserdata(state, (void*)complex);
lua_pushcclosure(state, complex_enum_ipairs, 2);
lua_setfield(state, ix_meta, "__ipairs");
lua_pushinteger(state, eid->getFirstItem());
lua_setfield(state, ftable, "_first_item");
lua_pushinteger(state, eid->getLastItem());
lua_setfield(state, ftable, "_last_item");
}
else
{

@ -1 +1 @@
Subproject commit d3491fa8790469e5325cf3f1ef1bf064b8011248
Subproject commit 028c4a3031d828122d7ad4efdbc0522251542891