Browse Source

filesystem: only allow setting true or false for boolean type keys in gameinfo/liblist.gam

pull/2/head
Alibek Omarov 1 year ago
parent
commit
83a5648335
  1. 10
      filesystem/filesystem.c

10
filesystem/filesystem.c

@ -770,13 +770,13 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
else if( !Q_stricmp( token, "secure" )) else if( !Q_stricmp( token, "secure" ))
{ {
pfile = COM_ParseFile( pfile, token, sizeof( token )); pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->secure = Q_atoi( token ); GameInfo->secure = Q_atoi( token ) ? true : false;
} }
// valid for both // valid for both
else if( !Q_stricmp( token, "nomodels" )) else if( !Q_stricmp( token, "nomodels" ))
{ {
pfile = COM_ParseFile( pfile, token, sizeof( token )); pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->nomodels = Q_atoi( token ); GameInfo->nomodels = Q_atoi( token ) ? true : false;
} }
else if( !Q_stricmp( token, isGameInfo ? "max_edicts" : "edicts" )) else if( !Q_stricmp( token, isGameInfo ? "max_edicts" : "edicts" ))
{ {
@ -844,17 +844,17 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
else if( !Q_stricmp( token, "noskills" )) else if( !Q_stricmp( token, "noskills" ))
{ {
pfile = COM_ParseFile( pfile, token, sizeof( token )); pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->noskills = Q_atoi( token ); GameInfo->noskills = Q_atoi( token ) ? true : false;
} }
else if( !Q_stricmp( token, "render_picbutton_text" )) else if( !Q_stricmp( token, "render_picbutton_text" ))
{ {
pfile = COM_ParseFile( pfile, token, sizeof( token )); pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->render_picbutton_text = Q_atoi( token ); GameInfo->render_picbutton_text = Q_atoi( token ) ? true : false;
} }
else if( !Q_stricmp( token, "internal_vgui_support" )) else if( !Q_stricmp( token, "internal_vgui_support" ))
{ {
pfile = COM_ParseFile( pfile, token, sizeof( token )); pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->internal_vgui_support = Q_atoi( token ); GameInfo->internal_vgui_support = Q_atoi( token ) ? true : false;
} }
else if( !Q_stricmp( token, "quicksave_aged_count" )) else if( !Q_stricmp( token, "quicksave_aged_count" ))
{ {

Loading…
Cancel
Save