Skip to content

Commit

Permalink
Fixes bugs regarding game features.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jun 1, 2024
1 parent f913cac commit 6915910
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/game_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ const std::type_index ModDataContentIndex{typeid(ModDataContent)};

class GameFeatures::CombinedModDataChecker : public ModDataChecker
{
std::vector<std::shared_ptr<ModDataChecker>> m_checkers;
std::vector<std::shared_ptr<ModDataChecker>> m_modDataCheckers;
mutable std::shared_ptr<ModDataChecker> m_fixer = nullptr;

public:
void setCheckers(std::vector<std::shared_ptr<ModDataChecker>> 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<const MOBase::IFileTree> fileTree) const override
{
m_fixer = nullptr;

for (auto& modDataChecker : m_checkers) {
for (auto& modDataChecker : m_modDataCheckers) {
auto check = modDataChecker->dataLooksValid(fileTree);

switch (check) {
Expand Down Expand Up @@ -78,6 +78,8 @@ class GameFeatures::CombinedModDataContent : public ModDataContent
std::vector<Content> m_allContents;

public:
bool isValid() const { return !m_modDataContents.empty(); }

void setContents(std::vector<std::shared_ptr<ModDataContent>> modDataContents)
{
m_modDataContents.clear();
Expand All @@ -103,8 +105,6 @@ class GameFeatures::CombinedModDataContent : public ModDataContent
}
}

bool isValid() const { return !m_modDataContents.empty(); }

std::vector<Content> getAllContents() const override { return m_allContents; }

std::vector<int>
Expand Down
4 changes: 2 additions & 2 deletions src/organizerproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ OrganizerProxy::OrganizerProxy(OrganizerCore* organizer,
m_ModListProxy(std::make_unique<ModListProxy>(this, organizer->modList())),
m_PluginListProxy(
std::make_unique<PluginListProxy>(this, organizer->pluginList())),
m_GameFeaturesProxy(std::make_unique<GameFeaturesProxy>(
this, organizer->pluginContainer().gameFeatures()))
m_GameFeaturesProxy(
std::make_unique<GameFeaturesProxy>(this, pluginContainer->gameFeatures()))
{}

OrganizerProxy::~OrganizerProxy()
Expand Down

0 comments on commit 6915910

Please sign in to comment.