]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace `IF(ALL,` with `APPLY(`
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 13 May 2015 23:27:58 +0000 (09:27 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 13 May 2015 23:27:58 +0000 (09:27 +1000)
qcsrc/common/items/item/ammo.qc
qcsrc/common/items/item/armor.qc
qcsrc/common/items/item/health.qc
qcsrc/common/items/item/jetpack.qc
qcsrc/common/items/item/powerup.qc
qcsrc/common/util-pre.qh
qcsrc/server/mutators/mutator_instagib.qc

index 449905ea5e37e37db4194c534951d0cbfedf9c5f..23f8d8aae5a36660426ba54b7721b9f02a99bb6b 100644 (file)
@@ -15,7 +15,7 @@
     ))
 
 DEFINE(Bullets
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/a_bullets.mdl"
     ,   name                =   "bullets"
     )
@@ -25,7 +25,7 @@ DEFINE(Bullets
     )
 )
 DEFINE(Cells
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/a_cells.md3"
     ,   name                =   "cells"
     )
@@ -35,7 +35,7 @@ DEFINE(Cells
     )
 )
 DEFINE(Plasma
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/a_cells.md3"
     ,   name                =   "plasma"
     )
@@ -45,7 +45,7 @@ DEFINE(Plasma
     )
 )
 DEFINE(Rockets
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/a_rockets.md3"
     ,   name                =   "rockets"
     )
@@ -55,7 +55,7 @@ DEFINE(Rockets
     )
 )
 DEFINE(Shells
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/a_shells.md3"
     ,   name                =   "shells"
     )
index 8cbc9cd8a2905ed2724f5bfb5e8b6b5d65eb1d41..4a3c9c022076de186edcf6b3781ff9d7006e3f52 100644 (file)
@@ -8,7 +8,7 @@
 #define DEFINE(id, ...) REGISTER_ITEM(id, Armor, MAP(IDENTITY, __VA_ARGS__))
 
 DEFINE(ArmorSmall
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/item_armor_small.md3"
     ,   sound               =   "misc/armor1.wav"
     ,   name                =   "5 Armor"
@@ -22,7 +22,7 @@ DEFINE(ArmorSmall
 )
 
 DEFINE(ArmorMedium
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/item_armor_medium.md3"
     ,   sound               =   "misc/armor10.wav"
     ,   name                =   "25 Armor"
@@ -36,7 +36,7 @@ DEFINE(ArmorMedium
 )
 
 DEFINE(ArmorBig
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/item_armor_big.md3"
     ,   sound               =   "misc/armor17_5.wav"
     ,   name                =   "50 Armor"
@@ -50,7 +50,7 @@ DEFINE(ArmorBig
 )
 
 DEFINE(ArmorLarge
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/item_armor_large.md3"
     ,   sound               =   "misc/armor25.wav"
     ,   name                =   "100 Armor"
index fba35e2a9473e6cdd346568be22008fa90593496..304bfd4a292209e8698d072fb17617a674200cb4 100644 (file)
@@ -8,7 +8,7 @@
 #define DEFINE(id, ...) REGISTER_ITEM(id, Health, MAP(IDENTITY, __VA_ARGS__))
 
 DEFINE(HealthSmall
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_h1.md3"
     ,   sound               =   "misc/minihealth.wav"
     ,   name                =   "5 Health"
@@ -22,7 +22,7 @@ DEFINE(HealthSmall
 )
 
 DEFINE(HealthMedium
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_h25.md3"
     ,   sound               =   "misc/mediumhealth.wav"
     ,   name                =   "25 Health"
@@ -36,7 +36,7 @@ DEFINE(HealthMedium
 )
 
 DEFINE(HealthLarge
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_h50.md3"
     ,   sound               =   "misc/mediumhealth.wav"
     ,   name                =   "50 Health"
@@ -50,7 +50,7 @@ DEFINE(HealthLarge
 )
 
 DEFINE(HealthMega
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_h100.md3"
     ,   sound               =   "misc/megahealth.wav"
     ,   name                =   "100 Health"
index d130b06cf52a4002b891385b3f7b453d18fd0eb1..963f63dfa0a685aab0c6cbeee7cb425a2957335f 100644 (file)
@@ -8,7 +8,7 @@
 #define DEFINE(id, ...) REGISTER_ITEM(id, Pickup, MAP(IDENTITY, __VA_ARGS__))
 
 DEFINE(Jetpack
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_jetpack.md3"
     ,   name                =   "Jet pack"
     )
@@ -23,7 +23,7 @@ DEFINE(Jetpack
 )
 
 DEFINE(JetpackFuel
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_fuel.md3"
     ,   name                =   "Fuel"
     )
@@ -37,7 +37,7 @@ DEFINE(JetpackFuel
 )
 
 DEFINE(JetpackRegen
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_fuelregen.md3"
     ,   name                =   "Fuel regenerator"
     )
index 9100e0bb3643430a4fe5cb84a2b8e8948e7dead3..ca54fa73f8c8254f9732c2ddd9f3897a812f0cff 100644 (file)
@@ -15,7 +15,7 @@
     ))
 
 DEFINE(Strength
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_strength.md3"
     ,   sound               =   "misc/powerup.wav"
     ,   name                =   "Strength Powerup"
@@ -25,7 +25,7 @@ DEFINE(Strength
     )
 )
 DEFINE(Shield
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_invincible.md3"
     ,   sound               =   "misc/powerup_shield.wav"
     ,   name                =   "Shield"
index 0ad822939ab6a557b90b1e19cab625c01ca3684c..8fe729e7f0dafdda415e8a1e9fdec5ffebfbc5da 100644 (file)
@@ -83,6 +83,8 @@
 
 #define IDENTITY(it) it
 
+#define APPLY(f, ...) f(__VA_ARGS__)
+
 #ifdef SVQC
     #define SV(f, ...) f(__VA_ARGS__)
 #else
@@ -95,9 +97,7 @@
     #define CL(f, ...)
 #endif
 
-#define ALL(f, ...) f(__VA_ARGS__)
-
-#define IF(pred, f, ...) pred(f, __VA_ARGS__)
+#define IF(cond, f, ...) cond(f, __VA_ARGS__)
 
 #define GET(name) name##get
 #define GETTER(type, name) type GET(name)() { return name; }
index 14a8c6bcb5ecf639f9a0bd08fc49b15306fc3beb..d24a4688b1e7160104cc2cb69ad3129b0fa094b8 100644 (file)
@@ -16,7 +16,7 @@ GETTER(float, instagib_respawntime_ammo)
 GETTER(float, instagib_respawntimejitter_ammo)
 
 REGISTER_ITEM(VaporizerCells, Pickup, MAP(IDENTITY
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/a_cells.md3"
     ,   sound               =   "misc/itempickup.wav"
     ,   name                =   "Vaporizer Ammo"
@@ -30,7 +30,7 @@ REGISTER_ITEM(VaporizerCells, Pickup, MAP(IDENTITY
 ))
 
 REGISTER_ITEM(ExtraLife, Pickup, MAP(IDENTITY
-    ,IF(ALL, CONFIGURE
+    ,APPLY(CONFIGURE
     ,   model               =   "models/items/g_h100.md3"
     ,   sound               =   "misc/megahealth.wav"
     ,   name                =   "Extralife"