From 83a5648335ebaf027fcfd9264bd5ad67cf934e42 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 27 Oct 2023 07:24:42 +0300 Subject: [PATCH] filesystem: only allow setting true or false for boolean type keys in gameinfo/liblist.gam --- filesystem/filesystem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/filesystem/filesystem.c b/filesystem/filesystem.c index f22f4fed..4843927d 100644 --- a/filesystem/filesystem.c +++ b/filesystem/filesystem.c @@ -770,13 +770,13 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool else if( !Q_stricmp( token, "secure" )) { pfile = COM_ParseFile( pfile, token, sizeof( token )); - GameInfo->secure = Q_atoi( token ); + GameInfo->secure = Q_atoi( token ) ? true : false; } // valid for both else if( !Q_stricmp( token, "nomodels" )) { 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" )) { @@ -844,17 +844,17 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool else if( !Q_stricmp( token, "noskills" )) { 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" )) { 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" )) { 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" )) {