Add support for single-file gamedata custom overrides (bug 5386, r=psychonic).

This commit is contained in:
Ondrej Hošek 2014-04-07 12:14:26 -04:00
parent 9badb14c3a
commit c3e9d7de41

View File

@ -792,8 +792,20 @@ bool CGameConfig::Reparse(char *error, size_t maxlength)
{
/* Nope, use the old mechanism. */
smcore.Format(path, sizeof(path), "%s.txt", m_File);
if (!EnterFile(path, error, maxlength))
{
return false;
}
/* Allow customization. */
g_pSM->BuildPath(Path_SM, path, sizeof(path), "gamedata/custom/%s.txt", m_File);
if (libsys->PathExists(path))
{
smcore.Format(path, sizeof(path), "custom/%s.txt", m_File);
return EnterFile(path, error, maxlength);
}
return true;
}
/* Otherwise, it's time to parse the master. */
SMCError err;