mirror of https://github.com/FWGS/xash3d-fwgs
filesystem: simplify common parsing of type key for liblist.gam and gameinfo.txt
This commit is contained in:
parent
d5f4b409e8
commit
8e16c0e410
|
@ -714,29 +714,36 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
|
||||||
{
|
{
|
||||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||||
|
|
||||||
if( !isGameInfo && !Q_stricmp( token, "singleplayer_only" ))
|
if( isGameInfo )
|
||||||
{
|
{
|
||||||
// TODO: Remove this ugly hack too.
|
Q_strncpy( GameInfo->type, token, sizeof( GameInfo->type ));
|
||||||
// This was made because Half-Life has multiplayer,
|
|
||||||
// but for some reason it's marked as singleplayer_only.
|
|
||||||
// Old WON version is fine.
|
|
||||||
if( !Q_stricmp( GameInfo->gamefolder, "valve") )
|
|
||||||
GameInfo->gamemode = GAME_NORMAL;
|
|
||||||
else
|
|
||||||
GameInfo->gamemode = GAME_SINGLEPLAYER_ONLY;
|
|
||||||
Q_strncpy( GameInfo->type, "Single", sizeof( GameInfo->type ));
|
|
||||||
}
|
|
||||||
else if( !isGameInfo && !Q_stricmp( token, "multiplayer_only" ))
|
|
||||||
{
|
|
||||||
GameInfo->gamemode = GAME_MULTIPLAYER_ONLY;
|
|
||||||
Q_strncpy( GameInfo->type, "Multiplayer", sizeof( GameInfo->type ));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// pass type without changes
|
if( !Q_stricmp( token, "singleplayer_only" ))
|
||||||
if( !isGameInfo )
|
{
|
||||||
GameInfo->gamemode = GAME_NORMAL;
|
// TODO: Remove this ugly hack too.
|
||||||
Q_strncpy( GameInfo->type, token, sizeof( GameInfo->type ));
|
// This was made because Half-Life has multiplayer,
|
||||||
|
// but for some reason it's marked as singleplayer_only.
|
||||||
|
// Old WON version is fine.
|
||||||
|
if( !Q_stricmp( GameInfo->gamefolder, "valve") )
|
||||||
|
GameInfo->gamemode = GAME_NORMAL;
|
||||||
|
else
|
||||||
|
GameInfo->gamemode = GAME_SINGLEPLAYER_ONLY;
|
||||||
|
Q_strncpy( GameInfo->type, "Single", sizeof( GameInfo->type ));
|
||||||
|
}
|
||||||
|
else if( !Q_stricmp( token, "multiplayer_only" ))
|
||||||
|
{
|
||||||
|
GameInfo->gamemode = GAME_MULTIPLAYER_ONLY;
|
||||||
|
Q_strncpy( GameInfo->type, "Multiplayer", sizeof( GameInfo->type ));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// pass type without changes
|
||||||
|
if( !isGameInfo )
|
||||||
|
GameInfo->gamemode = GAME_NORMAL;
|
||||||
|
Q_strncpy( GameInfo->type, token, sizeof( GameInfo->type ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// valid for both
|
// valid for both
|
||||||
|
|
Loading…
Reference in New Issue