]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nades/nades.qh
Nades code: don't use booleans as array indexes for m_projectile, optimize spawn_held...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nades / nades.qh
index 9c8aeedec86f9449dc5e3d80616ed177207fd970..e5fa0da8903379143b983852d03dab8b00335b35 100644 (file)
@@ -136,10 +136,7 @@ REGISTRY_DEFINE_GET(Nades, NADE_TYPE_Null)
 Nade Nade_FromProjectile(int proj)
 {
     FOREACH(Nades, true, {
-        for (int j = 0; j < 2; ++j)
-        {
-            if (it.m_projectile[j] == proj) return it;
-        }
+        if (it.m_projectile[0] == proj || it.m_projectile[1] == proj) return it;
     });
     return NADE_TYPE_Null;
 }