Add support for single-file gamedata custom overrides (bug 5386, r=psychonic).
This commit is contained in:
parent
9badb14c3a
commit
c3e9d7de41
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user