From: Mario Date: Sat, 18 Feb 2017 09:44:59 +0000 (+1000) Subject: Loop through items intrusive list instead of cycling through every single entity... X-Git-Tag: xonotic-v0.8.2~199 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=891f4589ec8ec305cdc134cc8fa610089ab16c14;p=xonotic%2Fxonotic-data.pk3dir.git Loop through items intrusive list instead of cycling through every single entity, should fix a runaway loop counter crash --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index b6f405fec..00b0dcf12 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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; }); } }