2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 09:56:22 +01:00

filesystem: simplify ambient number bound check

This commit is contained in:
Alibek Omarov 2024-11-17 13:04:37 +03:00
parent 229f1560b0
commit 8fd5a5af96

View File

@ -861,7 +861,7 @@ static void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, cons
{ {
int ambientNum = Q_atoi( token + 7 ); int ambientNum = Q_atoi( token + 7 );
if( ambientNum < 0 || ambientNum > ( NUM_AMBIENTS - 1 )) if( ambientNum < 0 || ambientNum >= NUM_AMBIENTS )
ambientNum = 0; ambientNum = 0;
pfile = COM_ParseFile( pfile, GameInfo->ambientsound[ambientNum], pfile = COM_ParseFile( pfile, GameInfo->ambientsound[ambientNum],
sizeof( GameInfo->ambientsound[ambientNum] )); sizeof( GameInfo->ambientsound[ambientNum] ));