- fixed: UDMF user value lists need to be sorted for binary search to work but weren't.

This commit is contained in:
Christoph Oelckers 2016-09-12 21:32:17 +02:00
parent b308a7df52
commit 823f75e592
2 changed files with 6 additions and 0 deletions

View file

@ -309,6 +309,11 @@ void FUDMFKeys::Sort()
FUDMFKey *FUDMFKeys::Find(FName key)
{
if (!mSorted)
{
mSorted = true;
Sort();
}
int min = 0, max = Size()-1;
while (min <= max)

View file

@ -220,6 +220,7 @@ struct FUDMFKey
class FUDMFKeys : public TArray<FUDMFKey>
{
bool mSorted = false;
public:
void Sort();
FUDMFKey *Find(FName key);