]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/gametypelist.qc
Some minor cleanups and optimizations
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / gametypelist.qc
index 3703393789eaa1125b6777b170d470612f2bea75..2de655940f70d124f67887fca042cb8678176f3f 100644 (file)
@@ -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);