]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Tidy up
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 13 May 2015 05:54:31 +0000 (15:54 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 13 May 2015 06:23:15 +0000 (16:23 +1000)
qcsrc/common/items/inventory.qh
qcsrc/server/mutators/mutator_instagib.qc

index 9b277bf679eae681e7fdf6d1ca70857058ff048f..89abc97cff2a82f252cca4730061a367b741c354 100644 (file)
@@ -16,8 +16,9 @@ void Inventory_Read(Inventory data)
 {
     const int bits = ReadInt24_t();
     ITEMS_FOREACH(bits & BIT(i), LAMBDA({
-        int prev = data.inv_items[i];
-        int next = data.inv_items[i] = ReadByte();
+        .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);
     }));
 }
@@ -28,8 +29,8 @@ void Inventory_Write(Inventory data)
 {
     int bits = 0;
     ITEMS_FOREACH(true, LAMBDA({
-        .int idx = inv_items[i];
-        bits = BITSET(bits, BIT(i), data.inventory.(idx) != (data.inventory.(idx) = data.(idx)));
+        .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({
index 7f97ba131396de1711005ca39a9998059e396a51..14a8c6bcb5ecf639f9a0bd08fc49b15306fc3beb 100644 (file)
@@ -18,13 +18,13 @@ GETTER(float, instagib_respawntimejitter_ammo)
 REGISTER_ITEM(VaporizerCells, Pickup, MAP(IDENTITY
     ,IF(ALL, CONFIGURE
     ,   model               =   "models/items/a_cells.md3"
-    ,  sound                           =       "misc/itempickup.wav"
+    ,   sound               =   "misc/itempickup.wav"
     ,   name                =   "Vaporizer Ammo"
     )
     ,IF(SV, CONFIGURE
     ,   botvalue            =   100
     ,   itemid              =   IT_CELLS
-    ,   respawntime         =            GET(instagib_respawntime_ammo)
+    ,   respawntime         =         GET(instagib_respawntime_ammo)
     ,   respawntimejitter   =   GET(instagib_respawntimejitter_ammo)
     )
 ))
@@ -32,14 +32,14 @@ REGISTER_ITEM(VaporizerCells, Pickup, MAP(IDENTITY
 REGISTER_ITEM(ExtraLife, Pickup, MAP(IDENTITY
     ,IF(ALL, CONFIGURE
     ,   model               =   "models/items/g_h100.md3"
-    ,  sound                           =       "misc/megahealth.wav"
+    ,   sound               =   "misc/megahealth.wav"
     ,   name                =   "Extralife"
     )
     ,IF(SV, CONFIGURE
     ,   botvalue            =   BOT_PICKUP_RATING_HIGH
-    ,  itemflags                       =       FL_POWERUP
+    ,   itemflags           =   FL_POWERUP
     ,   itemid              =   IT_NAILS
-    ,   respawntime         =            GET(g_pickup_respawntime_powerup)
+    ,   respawntime         =         GET(g_pickup_respawntime_powerup)
     ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
     )
 ))