Fix for new Reorder Omnifilter

Issue was found that when loading the Omnifilter without the order tag, the code was failing to load the rest of the data correctly. Fixed now by checking to see if the tag exists and if not, just add the name in the order of the map.
This commit is contained in:
minerjr
2026-06-14 14:10:27 -03:00
parent 5d7f198971
commit 75f9251173
+10 -1
View File
@@ -396,6 +396,7 @@ void OmnifilterEngine::loadNeedles()
mOrderedNeedles.clear();
// Pre-allocate space for the list of needle names, so we can use an index into it for assignments down below
mOrderedNeedles.resize(needles_llsd.size());
S32 index = 0;
// </FS:minerjr> [FIRE-36649]
for (const auto& [new_needle_name, needle_data] : llsd::inMap(needles_llsd))
{
@@ -432,7 +433,15 @@ void OmnifilterEngine::loadNeedles()
// Needles are stored in order added to the map originally so use the
// order value stored to restore the order back to the user
// defined order.
mOrderedNeedles[needle_data["order"].asInteger()] = new_needle_name;
if (needle_data.has("order"))
{
mOrderedNeedles[needle_data["order"].asInteger()] = new_needle_name;
}
else
{
mOrderedNeedles[index++] = new_needle_name;
}
// <FS:minerjr> [/FIRE-36649]
}
}