MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getUserEnginePath

Method getUserEnginePath

radiantcore/settings/GameManager.cpp:196–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196std::string Manager::getUserEnginePath()
197{
198#if defined(POSIX)
199
200 // First check for a local copy of the game tree, e.g. ~/.doom3
201 std::string localGamePrefix = currentGame()->getKeyValue("prefix");
202 if (!localGamePrefix.empty())
203 {
204 std::string homeDir = getenv("HOME");
205 fs::path localPath = fs::path(homeDir) / localGamePrefix;
206
207 if (fs::exists(localPath))
208 {
209 return os::standardPathWithSlash(localPath);
210 }
211 }
212
213#endif
214
215 // Otherwise (Windows, or no local mod path found) return the regular engine path
216 return _config.enginePath;
217}
218
219const GameConfiguration& Manager::getConfig() const
220{

Callers 4

populateWindowMethod · 0.45
populateWindowMethod · 0.45
getWritableGamePathMethod · 0.45

Calls 3

standardPathWithSlashFunction · 0.50
getKeyValueMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected