Fix element identifiers not being accepted by tpt __newindex
Becuase *of course* whether it succeds or not depends on whether you've rebuilt menus. With all seriousness, the real culprit here is GameModel::GetToolFromIdentifier, which looks for tools in the menu section tool lists, plus another list with tools that aren't in any menu section. This is absolutely blaphemous, but I don't feel like refactoring this right now. It also wouldn't be a problem in itself, but allocating an element also doesn't rebuild these lists, only changing the MenuSection property and a few other obscure operations do. This makes allocating elements also rebuild these lists.
This commit is contained in:
parent
a463180e2a
commit
11188c85c3
@ -2827,6 +2827,7 @@ int LuaScriptInterface::elements_allocate(lua_State * l)
|
|||||||
luacon_ci->custom_can_move[elem][newID] = 0;
|
luacon_ci->custom_can_move[elem][newID] = 0;
|
||||||
luacon_ci->custom_can_move[newID][elem] = 0;
|
luacon_ci->custom_can_move[newID][elem] = 0;
|
||||||
}
|
}
|
||||||
|
luacon_model->BuildMenus();
|
||||||
luacon_ci->custom_init_can_move();
|
luacon_ci->custom_init_can_move();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user