]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Loop through items intrusive list instead of cycling through every single entity...
authorMario <mario@smbclan.net>
Sat, 18 Feb 2017 09:44:59 +0000 (19:44 +1000)
committerMario <mario@smbclan.net>
Sat, 18 Feb 2017 09:44:59 +0000 (19:44 +1000)
qcsrc/common/t_items.qc

index b6f405fec019b5cb8ef6249b3c07a77f02c7fc32..00b0dcf12b5d342c46cbf44b09172d74dbd4fda8 100644 (file)
@@ -1332,7 +1332,7 @@ void setItemGroup(entity this)
                        {
                                int grY = it.item_group;
                                // move all items of item_group Y to item_group X
-                               FOREACH_ENTITY(IS_SMALL(it.itemdef),
+                               IL_EACH(g_items, IS_SMALL(it.itemdef),
                                {
                                        if(it.item_group == grY)
                                                it.item_group = this.item_group;
@@ -1347,9 +1347,9 @@ void setItemGroupCount()
        for (int k = 1; k <= group_count; k++)
        {
                int count = 0;
-               FOREACH_ENTITY(IS_SMALL(it.itemdef) && it.item_group == k, { count++; });
+               IL_EACH(g_items, IS_SMALL(it.itemdef) && it.item_group == k, { count++; });
                if (count)
-                       FOREACH_ENTITY(IS_SMALL(it.itemdef) && it.item_group == k, { it.item_group_count = count; });
+                       IL_EACH(g_items, IS_SMALL(it.itemdef) && it.item_group == k, { it.item_group_count = count; });
        }
 }