Make CS:GO recognize both / and \ for GetMapDisplayName (#592)
This commit is contained in:
parent
9d932b47fd
commit
8ad5862461
@ -1259,7 +1259,8 @@ bool CHalfLife2::GetMapDisplayName(const char *pMapName, char *pDisplayname, siz
|
|||||||
|
|
||||||
char *lastSlashPos;
|
char *lastSlashPos;
|
||||||
// In CSGO, workshop maps show up as workshop/123456789/mapname or workshop\123456789\mapname depending on OS
|
// In CSGO, workshop maps show up as workshop/123456789/mapname or workshop\123456789\mapname depending on OS
|
||||||
if (strncmp(pDisplayname, workshop, 9) == 0 && (lastSlashPos = strrchr(pDisplayname, PLATFORM_SEP_CHAR)) != NULL)
|
// As on sometime in 2016, CS:GO for Windows now recognizes both / and \ so we need to check for both
|
||||||
|
if (strncmp(pDisplayname, workshop, 9) == 0 && ((lastSlashPos = strrchr(pDisplayname, '/')) != NULL || (lastSlashPos = strrchr(pDisplayname, '\\')) != NULL))
|
||||||
{
|
{
|
||||||
ke::SafeStrcpy(pDisplayname, nMapNameMax, &lastSlashPos[1]);
|
ke::SafeStrcpy(pDisplayname, nMapNameMax, &lastSlashPos[1]);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user