]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/inventory.qh
Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / inventory.qh
index 89abc97cff2a82f252cca4730061a367b741c354..8b0d43305d9b243eb8eec33028079ebc4b125745 100644 (file)
@@ -15,12 +15,12 @@ class(Inventory) .int inv_items[MAX_ITEMS];
 void Inventory_Read(Inventory data)
 {
     const int bits = ReadInt24_t();
-    ITEMS_FOREACH(bits & BIT(i), LAMBDA({
+    FOREACH(ITEMS, bits & BIT(i), LAMBDA(
         .int fld = inv_items[i];
         int prev = data.(fld);
         int next = data.(fld) = ReadByte();
         dprintf("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
-    }));
+    ));
 }
 #endif
 
@@ -28,14 +28,14 @@ void Inventory_Read(Inventory data)
 void Inventory_Write(Inventory data)
 {
     int bits = 0;
-    ITEMS_FOREACH(true, LAMBDA({
+    FOREACH(ITEMS, true, LAMBDA(
         .int fld = inv_items[i];
         bits = BITSET(bits, BIT(i), data.inventory.(fld) != (data.inventory.(fld) = data.(fld)));
-    }));
+    ));
     WriteInt24_t(MSG_ENTITY, bits);
-    ITEMS_FOREACH(bits & BIT(i), LAMBDA({
+    FOREACH(ITEMS, bits & BIT(i), LAMBDA(
         WriteByte(MSG_ENTITY, data.inv_items[i]);
-    }));
+    ));
 }
 #endif