]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc
Compact weapon flag checks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_create_mutators.qc
index 21e7ecadc454fdc7168a1e0c5314892f5d028749..33fe3575a8bde07be1326970f232e4087667cf6d 100644 (file)
@@ -37,10 +37,11 @@ string WeaponArenaString()
        s = "";
        for(int j = 0; j < n; ++j)
        {
-               FOREACH(Weapons, it != WEP_Null, {
-                       if(argv(j) == it.netname)
-                               s = cons_mid(s, " & ", it.m_name);
-               });
+               Weapon wep = Weapons_fromstr(argv(j));
+               if(wep != WEP_Null)
+               {
+                       s = cons_mid(s, " & ", wep.m_name);
+               }
        }
        s = sprintf(_("%s Arena"), s);
 
@@ -250,7 +251,7 @@ void XonoticMutatorsDialog_fill(entity me)
        for(i = WEP_FIRST, j = 0; i <= WEP_LAST; ++i)
        {
                w = Weapons_from(i);
-               if(w.spawnflags & WEP_FLAG_HIDDEN)
+               if (w.spawnflags & (WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK))
                        continue;
                if ((j % 3) == 0)
                {