mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
[XPlane] Model set must not contain ACF models
Discussion: see https://discordapp.com/channels/539048679160676382/539064750055751690/648974956306366499
This commit is contained in:
committed by
Mat Sutcliffe
parent
b9ea40e8d1
commit
386a0ccd5d
@@ -947,6 +947,11 @@ namespace BlackMisc
|
||||
return diff;
|
||||
}
|
||||
|
||||
int CAircraftModelList::removeXPlaneFlyablePlanes()
|
||||
{
|
||||
return this->removeIfExcluded();
|
||||
}
|
||||
|
||||
int CAircraftModelList::removeByDistributor(const CDistributor &distributor)
|
||||
{
|
||||
return this->removeIf(&CAircraftModel::getDistributor, distributor);
|
||||
|
||||
@@ -340,6 +340,9 @@ namespace BlackMisc
|
||||
//! \return number of elements removed
|
||||
int removeIfExcluded();
|
||||
|
||||
//! Remove the XPlane flyable planes
|
||||
int removeXPlaneFlyablePlanes();
|
||||
|
||||
//! Remove by distributor
|
||||
//! \return number of elements removed
|
||||
int removeByDistributor(const CDistributor &distributor);
|
||||
|
||||
@@ -438,6 +438,15 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||
CAircraftModelList orderedModels(models);
|
||||
orderedModels.setModelType(CAircraftModel::TypeOwnSimulatorModel); // unify type
|
||||
|
||||
if (simulator.isXPlane())
|
||||
{
|
||||
// see https://discordapp.com/channels/539048679160676382/539064750055751690/648974956306366499
|
||||
// this solves the issue that ACF models are loaded in CSimulatorXPlane::loadCslPackages
|
||||
const int removed = orderedModels.removeXPlaneFlyablePlanes();
|
||||
if (removed > 0) { CLogMessage(this).info(u"Removed %1 flyable models from XPlane model set!"); }
|
||||
}
|
||||
|
||||
if (orderedModels.needsOrder())
|
||||
{
|
||||
orderedModels.resetOrder();
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace BlackMisc
|
||||
|
||||
CAircraftModelList CAircraftModelLoaderXPlane::parseFlyableAirplanes(const QString &rootDirectory, const QStringList &excludeDirectories)
|
||||
{
|
||||
Q_UNUSED(excludeDirectories);
|
||||
Q_UNUSED(excludeDirectories)
|
||||
if (rootDirectory.isEmpty()) { return {}; }
|
||||
|
||||
QDir searchPath(rootDirectory, fileFilterFlyable());
|
||||
|
||||
Reference in New Issue
Block a user