mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-25 22:34:24 +00:00
filesystem: simplify common parsing of type key for liblist.gam and gameinfo.txt
This commit is contained in:
parent
d5f4b409e8
commit
8e16c0e410
@ -714,7 +714,13 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
|
||||
{
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
|
||||
if( !isGameInfo && !Q_stricmp( token, "singleplayer_only" ))
|
||||
if( isGameInfo )
|
||||
{
|
||||
Q_strncpy( GameInfo->type, token, sizeof( GameInfo->type ));
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !Q_stricmp( token, "singleplayer_only" ))
|
||||
{
|
||||
// TODO: Remove this ugly hack too.
|
||||
// This was made because Half-Life has multiplayer,
|
||||
@ -726,7 +732,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
|
||||
GameInfo->gamemode = GAME_SINGLEPLAYER_ONLY;
|
||||
Q_strncpy( GameInfo->type, "Single", sizeof( GameInfo->type ));
|
||||
}
|
||||
else if( !isGameInfo && !Q_stricmp( token, "multiplayer_only" ))
|
||||
else if( !Q_stricmp( token, "multiplayer_only" ))
|
||||
{
|
||||
GameInfo->gamemode = GAME_MULTIPLAYER_ONLY;
|
||||
Q_strncpy( GameInfo->type, "Multiplayer", sizeof( GameInfo->type ));
|
||||
@ -739,6 +745,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
|
||||
Q_strncpy( GameInfo->type, token, sizeof( GameInfo->type ));
|
||||
}
|
||||
}
|
||||
}
|
||||
// valid for both
|
||||
else if( !Q_stricmp( token, "version" ))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user