mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-23 19:20:56 +00:00
Fix content names for layouts inserted with :add()
This commit is contained in:
parent
096255534a
commit
aea2c019de
@ -44,11 +44,10 @@ namespace LuaUi
|
||||
|
||||
void Content::insert(size_t index, const sol::table& table)
|
||||
{
|
||||
size_t size = mOrdered.size();
|
||||
if (size < index)
|
||||
if (mOrdered.size() < index)
|
||||
throw std::logic_error("Can't have gaps in UI Content.");
|
||||
mOrdered.insert(mOrdered.begin() + index, table);
|
||||
for (size_t i = index; i < size; ++i)
|
||||
for (size_t i = index; i < mOrdered.size(); ++i)
|
||||
{
|
||||
sol::optional<std::string> name = mOrdered[i]["name"];
|
||||
if (name.has_value())
|
||||
|
Loading…
x
Reference in New Issue
Block a user