Check all possible mapcycle paths on newer orangebox games (bug 5719, r=asherkin).
This commit is contained in:
parent
fa0df413f4
commit
8fe6d09613
@ -127,6 +127,8 @@ public:
|
|||||||
SMCError error;
|
SMCError error;
|
||||||
time_t fileTime;
|
time_t fileTime;
|
||||||
SMCStates states = {0, 0};
|
SMCStates states = {0, 0};
|
||||||
|
const char *pMapCycleFileName;
|
||||||
|
const char *pEngineName;
|
||||||
|
|
||||||
fileFound = libsys->FileTime(m_ConfigFile, FileTime_LastChange, &fileTime);
|
fileFound = libsys->FileTime(m_ConfigFile, FileTime_LastChange, &fileTime);
|
||||||
|
|
||||||
@ -156,11 +158,47 @@ public:
|
|||||||
|
|
||||||
pDefList->bIsPath = true;
|
pDefList->bIsPath = true;
|
||||||
smcore.strncopy(pDefList->name, "mapcyclefile", sizeof(pDefList->name));
|
smcore.strncopy(pDefList->name, "mapcyclefile", sizeof(pDefList->name));
|
||||||
|
|
||||||
|
pMapCycleFileName = m_pMapCycleFile ? smcore.GetCvarString(m_pMapCycleFile) : "mapcycle.txt";
|
||||||
|
|
||||||
|
pEngineName = smcore.GetSourceEngineName();
|
||||||
|
|
||||||
|
if (strcmp(pEngineName, "tf2") == 0 || strcmp(pEngineName, "css") == 0
|
||||||
|
|| strcmp(pEngineName, "dods") == 0 || strcmp(pEngineName, "hl2dm") == 0)
|
||||||
|
{
|
||||||
|
// These four games and Source SDK 2013 do a lookup in this order; so shall we.
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pDefList->path,
|
||||||
|
sizeof(pDefList->path),
|
||||||
|
"cfg/%s",
|
||||||
|
pMapCycleFileName);
|
||||||
|
|
||||||
|
if (!libsys->PathExists(pDefList->path))
|
||||||
|
{
|
||||||
g_pSM->BuildPath(Path_Game,
|
g_pSM->BuildPath(Path_Game,
|
||||||
pDefList->path,
|
pDefList->path,
|
||||||
sizeof(pDefList->path),
|
sizeof(pDefList->path),
|
||||||
"%s",
|
"%s",
|
||||||
m_pMapCycleFile ? smcore.GetCvarString(m_pMapCycleFile) : "mapcycle.txt");
|
pMapCycleFileName);
|
||||||
|
|
||||||
|
if (!libsys->PathExists(pDefList->path))
|
||||||
|
{
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pDefList->path,
|
||||||
|
sizeof(pDefList->path),
|
||||||
|
"cfg/mapcycle_default.txt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_pSM->BuildPath(Path_Game,
|
||||||
|
pDefList->path,
|
||||||
|
sizeof(pDefList->path),
|
||||||
|
"%s",
|
||||||
|
pMapCycleFileName);
|
||||||
|
}
|
||||||
|
|
||||||
pDefList->last_modified_time = 0;
|
pDefList->last_modified_time = 0;
|
||||||
pDefList->pArray = NULL;
|
pDefList->pArray = NULL;
|
||||||
pDefList->serial = 0;
|
pDefList->serial = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user