X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fgametypelist.qc;h=2de655940f70d124f67887fca042cb8678176f3f;hb=27bc18f43e9d09ffa55bca593e48e69c2c734d15;hp=3703393789eaa1125b6777b170d470612f2bea75;hpb=e7e4e095eaeac5b8dbc60723f239547bdee88ef5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/gametypelist.qc b/qcsrc/menu/xonotic/gametypelist.qc index 370339378..2de655940 100644 --- a/qcsrc/menu/xonotic/gametypelist.qc +++ b/qcsrc/menu/xonotic/gametypelist.qc @@ -31,16 +31,17 @@ void XonoticGametypeList_setSelected(entity me, float i) void XonoticGametypeList_loadCvars(entity me) { Gametype t = MapInfo_CurrentGametype(); + int cnt = GameType_GetCount(); float i; - for(i = 0; i < GameType_GetCount(); ++i) + for(i = 0; i < cnt; ++i) if(t == GameType_GetID(i)) break; - if(i >= GameType_GetCount()) + if(i >= cnt) { - for(i = 0; i < GameType_GetCount(); ++i) + for(i = 0; i < cnt; ++i) if(t == MAPINFO_TYPE_DEATHMATCH) break; - if(i >= GameType_GetCount()) + if(i >= cnt) i = 0; } me.setSelected(me, i);