From 8fd5a5af96544494bbb611f5a16e280d885c46e2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 17 Nov 2024 13:04:37 +0300 Subject: [PATCH] filesystem: simplify ambient number bound check --- filesystem/filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/filesystem.c b/filesystem/filesystem.c index d4f14bec..f2a15210 100644 --- a/filesystem/filesystem.c +++ b/filesystem/filesystem.c @@ -861,7 +861,7 @@ static void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, cons { int ambientNum = Q_atoi( token + 7 ); - if( ambientNum < 0 || ambientNum > ( NUM_AMBIENTS - 1 )) + if( ambientNum < 0 || ambientNum >= NUM_AMBIENTS ) ambientNum = 0; pfile = COM_ParseFile( pfile, GameInfo->ambientsound[ambientNum], sizeof( GameInfo->ambientsound[ambientNum] ));