mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +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;
|
return diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CAircraftModelList::removeXPlaneFlyablePlanes()
|
||||||
|
{
|
||||||
|
return this->removeIfExcluded();
|
||||||
|
}
|
||||||
|
|
||||||
int CAircraftModelList::removeByDistributor(const CDistributor &distributor)
|
int CAircraftModelList::removeByDistributor(const CDistributor &distributor)
|
||||||
{
|
{
|
||||||
return this->removeIf(&CAircraftModel::getDistributor, distributor);
|
return this->removeIf(&CAircraftModel::getDistributor, distributor);
|
||||||
|
|||||||
@@ -340,6 +340,9 @@ namespace BlackMisc
|
|||||||
//! \return number of elements removed
|
//! \return number of elements removed
|
||||||
int removeIfExcluded();
|
int removeIfExcluded();
|
||||||
|
|
||||||
|
//! Remove the XPlane flyable planes
|
||||||
|
int removeXPlaneFlyablePlanes();
|
||||||
|
|
||||||
//! Remove by distributor
|
//! Remove by distributor
|
||||||
//! \return number of elements removed
|
//! \return number of elements removed
|
||||||
int removeByDistributor(const CDistributor &distributor);
|
int removeByDistributor(const CDistributor &distributor);
|
||||||
|
|||||||
@@ -438,6 +438,15 @@ namespace BlackMisc
|
|||||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||||
CAircraftModelList orderedModels(models);
|
CAircraftModelList orderedModels(models);
|
||||||
orderedModels.setModelType(CAircraftModel::TypeOwnSimulatorModel); // unify type
|
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())
|
if (orderedModels.needsOrder())
|
||||||
{
|
{
|
||||||
orderedModels.resetOrder();
|
orderedModels.resetOrder();
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
CAircraftModelList CAircraftModelLoaderXPlane::parseFlyableAirplanes(const QString &rootDirectory, const QStringList &excludeDirectories)
|
CAircraftModelList CAircraftModelLoaderXPlane::parseFlyableAirplanes(const QString &rootDirectory, const QStringList &excludeDirectories)
|
||||||
{
|
{
|
||||||
Q_UNUSED(excludeDirectories);
|
Q_UNUSED(excludeDirectories)
|
||||||
if (rootDirectory.isEmpty()) { return {}; }
|
if (rootDirectory.isEmpty()) { return {}; }
|
||||||
|
|
||||||
QDir searchPath(rootDirectory, fileFilterFlyable());
|
QDir searchPath(rootDirectory, fileFilterFlyable());
|
||||||
|
|||||||
Reference in New Issue
Block a user