From 6915910d713a8009ec95c225d108387ed82008cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sat, 1 Jun 2024 14:46:25 +0200 Subject: [PATCH] Fixes bugs regarding game features. --- src/game_features.cpp | 14 +++++++------- src/organizerproxy.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game_features.cpp b/src/game_features.cpp index e073d3a70..49dd2988c 100644 --- a/src/game_features.cpp +++ b/src/game_features.cpp @@ -28,24 +28,24 @@ const std::type_index ModDataContentIndex{typeid(ModDataContent)}; class GameFeatures::CombinedModDataChecker : public ModDataChecker { - std::vector> m_checkers; + std::vector> m_modDataCheckers; mutable std::shared_ptr m_fixer = nullptr; public: void setCheckers(std::vector> checkers) { - m_checkers = std::move(checkers); - m_fixer = nullptr; + m_modDataCheckers = std::move(checkers); + m_fixer = nullptr; } - bool isValid() const { return m_checkers.empty(); } + bool isValid() const { return !m_modDataCheckers.empty(); } CheckReturn dataLooksValid(std::shared_ptr fileTree) const override { m_fixer = nullptr; - for (auto& modDataChecker : m_checkers) { + for (auto& modDataChecker : m_modDataCheckers) { auto check = modDataChecker->dataLooksValid(fileTree); switch (check) { @@ -78,6 +78,8 @@ class GameFeatures::CombinedModDataContent : public ModDataContent std::vector m_allContents; public: + bool isValid() const { return !m_modDataContents.empty(); } + void setContents(std::vector> modDataContents) { m_modDataContents.clear(); @@ -103,8 +105,6 @@ class GameFeatures::CombinedModDataContent : public ModDataContent } } - bool isValid() const { return !m_modDataContents.empty(); } - std::vector getAllContents() const override { return m_allContents; } std::vector diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index 77d973949..6edbdbab7 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -27,8 +27,8 @@ OrganizerProxy::OrganizerProxy(OrganizerCore* organizer, m_ModListProxy(std::make_unique(this, organizer->modList())), m_PluginListProxy( std::make_unique(this, organizer->pluginList())), - m_GameFeaturesProxy(std::make_unique( - this, organizer->pluginContainer().gameFeatures())) + m_GameFeaturesProxy( + std::make_unique(this, pluginContainer->gameFeatures())) {} OrganizerProxy::~OrganizerProxy()