MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LooksLikeMod

Function LooksLikeMod

engine/Poseidon/Core/ModCollection.cpp:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147} // namespace
148
149bool LooksLikeMod(const std::string& dir)
150{
151 namespace fs = std::filesystem;
152 std::error_code ec;
153 for (fs::directory_iterator it(dir, ec), end; it != end; it.increment(ec))
154 {
155 if (ec)
156 break;
157 const std::string name = LowerAscii(it->path().filename().string());
158 std::error_code mec;
159 // addons/dta/campaigns + a bin/ config override are what a mod changes.
160 // Missions/MPMissions are deliberately excluded — mission packs are a
161 // separate content type, not mods.
162 if (it->is_directory(mec) && (name == "addons" || name == "dta" || name == "bin" || name == "campaigns"))
163 return true;
164 if (it->is_regular_file(mec) && name == "mod.json")
165 return true;
166 }
167 return false;
168}
169
170std::vector<Mod> ScanModsRoot(const std::string& root, ModSource source)

Callers 3

AbsoluteResolvedModPathFunction · 0.85
ScanModsRootFunction · 0.85

Calls 1

LowerAsciiFunction · 0.70

Tested by

no test coverage detected