1
0
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:
uramer 2022-03-29 20:17:48 +02:00
parent 096255534a
commit aea2c019de

View File

@ -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())