Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/Mod.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
Mod g_ModInstance; | Mod g_ModInstance; | ||||
bool LoadModJSON(const PIVFS& vfs, OsPath modsPath, OsPath mod, std::string& text) | bool LoadModJSON(const PIVFS& vfs, OsPath modsPath, OsPath mod, std::string& text) | ||||
{ | { | ||||
#if OS_WIN | #if OS_WIN | ||||
const std::filesystem::path modJsonPath = (modsPath / mod / L"mod.json").fileSystemPath(); | const std::filesystem::path modJsonPath = (modsPath / mod / L"mod.json").fileSystemPath(); | ||||
#else | #else | ||||
const char* modJsonPath = OsString(modsPath / mod / L"mod.json").c_str(); | const std::string modJsonPath = OsString(modsPath / mod / L"mod.json"); | ||||
#endif | #endif | ||||
// Attempt to open mod.json first. | // Attempt to open mod.json first. | ||||
std::ifstream modjson(modJsonPath); | std::ifstream modjson(modJsonPath); | ||||
if (!modjson) | if (!modjson) | ||||
{ | { | ||||
modjson.close(); | modjson.close(); | ||||
// Fallback: open the archive and read mod.json there. | // Fallback: open the archive and read mod.json there. | ||||
▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator