From: terencehill Date: Mon, 7 Feb 2011 18:05:49 +0000 (+0100) Subject: Fix Map Info dialog can be opened by pressing ENTER in the map list if there are... X-Git-Tag: xonotic-v0.5.0~311^2~29^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2bf3575f04ef2dc4c43a4c9b0545ff5c1ac54336;p=xonotic%2Fxonotic-data.pk3dir.git Fix Map Info dialog can be opened by pressing ENTER in the map list if there are no maps for the current gametype This bug fix also disables other keys when there are no maps as there's nothing to do --- diff --git a/qcsrc/menu/xonotic/maplist.c b/qcsrc/menu/xonotic/maplist.c index 1390ff3b1..69757126b 100644 --- a/qcsrc/menu/xonotic/maplist.c +++ b/qcsrc/menu/xonotic/maplist.c @@ -297,6 +297,8 @@ void MapList_LoadMap(entity btn, entity me) float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) { string ch, save; + if(me.nItems <= 0) + return SUPER(XonoticMapList).keyDown(me, scan, ascii, shift); if(scan == K_ENTER || scan == K_KP_ENTER) { // pop up map info screen