From 50c86fa4c3376d7d3b635dda54a1037f3cddd170 Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Fri, 30 Oct 2009 02:06:38 +0000 Subject: * Fix for listmaps command misbehaving when searching for something that returns zero results (Rezyn) --- src/game/g_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 4fcaf1b7..2d4a2344 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2858,7 +2858,7 @@ void Cmd_ListMaps_f( gentity_t *ent ) qsort( fileSort, count, sizeof( fileSort[ 0 ] ), SortMaps ); rows = ( count + 2 ) / 3; - pages = ( rows + MAX_MAPLIST_ROWS - 1 ) / MAX_MAPLIST_ROWS; + pages = MAX( 1, ( rows + MAX_MAPLIST_ROWS - 1 ) / MAX_MAPLIST_ROWS ); if( page >= pages ) page = pages - 1; -- cgit