- fixed missing check for bad IWADs.

This commit is contained in:
Christoph Oelckers 2017-08-27 09:57:37 +02:00
parent 2e670ae71d
commit ca47b138be

View file

@ -598,14 +598,17 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
bool picked = false; bool picked = false;
for (int j = 0; j < (int)mFoundWads.Size(); j++) for (int j = 0; j < (int)mFoundWads.Size(); j++)
{ {
if (mIWadInfos[mFoundWads[j].mInfoIndex].Name.Compare(mOrderNames[i]) == 0) if (mFoundWads[j].mInfoIndex >= 0)
{ {
if (!picked) if (mIWadInfos[mFoundWads[j].mInfoIndex].Name.Compare(mOrderNames[i]) == 0)
{ {
picked = true; if (!picked)
picks.Push(mFoundWads[j]); {
picked = true;
picks.Push(mFoundWads[j]);
}
mFoundWads.Delete(j--);
} }
mFoundWads.Delete(j--);
} }
} }
} }