]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/inventory.qh
Net: purge SELFPARAM from sendfuncs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / inventory.qh
index 64fa29cfc9f31fa312a567bd1dbcd3245caa3257..a6d266ae5fba57d3d50727b25cb41d1fe1c396e2 100644 (file)
@@ -15,11 +15,11 @@ class(Inventory) .int inv_items[Items_MAX];
 void Inventory_Read(Inventory data)
 {
     const int bits = ReadInt24_t();
-    FOREACH(Items, bits & BIT(i), LAMBDA(
-        .int fld = inv_items[i];
+    FOREACH(Items, bits & BIT(it.m_id), LAMBDA(
+        .int fld = inv_items[it.m_id];
         int prev = data.(fld);
         int next = data.(fld) = ReadByte();
-        LOG_TRACEF("%s: %.0f -> %.0f\n", Items[i].m_name, prev, next);
+        LOG_TRACEF("%s: %.0f -> %.0f\n", it.m_name, prev, next);
     ));
 }
 #endif
@@ -29,19 +29,19 @@ void Inventory_Write(Inventory data)
 {
     int bits = 0;
     FOREACH(Items, true, LAMBDA(
-        .int fld = inv_items[i];
-        bits = BITSET(bits, BIT(i), data.inventory.(fld) != (data.inventory.(fld) = data.(fld)));
+        .int fld = inv_items[it.m_id];
+        bits = BITSET(bits, BIT(it.m_id), data.inventory.(fld) != (data.inventory.(fld) = data.(fld)));
     ));
     WriteInt24_t(MSG_ENTITY, bits);
-    FOREACH(Items, bits & BIT(i), LAMBDA(
-        WriteByte(MSG_ENTITY, data.inv_items[i]);
+    FOREACH(Items, bits & BIT(it.m_id), LAMBDA(
+        WriteByte(MSG_ENTITY, data.inv_items[it.m_id]);
     ));
 }
 #endif
 
 #ifdef SVQC
-bool Inventory_Send(entity to, int sf)
-{SELFPARAM();
+bool Inventory_Send(entity this, entity to, int sf)
+{
     WriteByte(MSG_ENTITY, ENT_CLIENT_INVENTORY);
     entity e = self.owner;
     if (IS_SPEC(e)) e = e.enemy;