mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-06 18:08:31 +00:00
Add null check in new -game fallback
This commit is contained in:
parent
567084afd4
commit
d6ed4443e8
@ -224,17 +224,20 @@ mm_GetGameName(char *buffer, size_t size)
|
|||||||
// we can't even set MM:S path with GameBin instead of Game, the first Game path will always be MM:S's
|
// we can't even set MM:S path with GameBin instead of Game, the first Game path will always be MM:S's
|
||||||
// location, rather than the real Game dir
|
// location, rather than the real Game dir
|
||||||
char *pszAppId = std::getenv("SteamAppId");
|
char *pszAppId = std::getenv("SteamAppId");
|
||||||
switch (strtoul(pszAppId, nullptr, 10))
|
if (pszAppId)
|
||||||
{
|
{
|
||||||
case 570ul:
|
switch (strtoul(pszAppId, nullptr, 10))
|
||||||
strncpy(buffer, "dota", size);
|
{
|
||||||
break;
|
case 570ul:
|
||||||
case 730ul:
|
strncpy(buffer, "dota", size);
|
||||||
strncpy(buffer, "csgo", size);
|
break;
|
||||||
break;
|
case 730ul:
|
||||||
case 1422450ul:
|
strncpy(buffer, "csgo", size);
|
||||||
strncpy(buffer, "citadel", size);
|
break;
|
||||||
break;
|
case 1422450ul:
|
||||||
|
strncpy(buffer, "citadel", size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user