X-Plane model loader: fixed malformed model strings with spurious multiple liveries.

Each livery was being appended to the model string of the previous livery model.
Reported by Alex Beavil.
This commit is contained in:
Mathew Sutcliffe
2017-05-07 21:52:14 +01:00
parent b1e57e28d0
commit 183d3f58e7

View File

@@ -269,11 +269,12 @@ namespace BlackMisc
if (!model.hasDescription()) { model.setDescription(descriptionForFlyableModel(model)); }
addUniqueModel(model, installedModels);
const QString baseModelString = model.getModelString();
QDirIterator liveryIt(aircraftIt.fileInfo().canonicalPath() + "/liveries", QDir::Dirs | QDir::NoDotAndDotDot);
while (liveryIt.hasNext())
{
liveryIt.next();
model.setModelString(model.getModelString() % ' ' % liveryIt.fileName());
model.setModelString(baseModelString % ' ' % liveryIt.fileName());
addUniqueModel(model, installedModels);
}
}