From: TimePath Date: Wed, 13 May 2015 23:27:58 +0000 (+1000) Subject: Replace `IF(ALL,` with `APPLY(` X-Git-Tag: xonotic-v0.8.1~53^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=81ca4b6b7968b18d1da5aed05409a09512624ac6;p=xonotic%2Fxonotic-data.pk3dir.git Replace `IF(ALL,` with `APPLY(` --- diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 449905ea5..23f8d8aae 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -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" ) diff --git a/qcsrc/common/items/item/armor.qc b/qcsrc/common/items/item/armor.qc index 8cbc9cd8a..4a3c9c022 100644 --- a/qcsrc/common/items/item/armor.qc +++ b/qcsrc/common/items/item/armor.qc @@ -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" diff --git a/qcsrc/common/items/item/health.qc b/qcsrc/common/items/item/health.qc index fba35e2a9..304bfd4a2 100644 --- a/qcsrc/common/items/item/health.qc +++ b/qcsrc/common/items/item/health.qc @@ -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" diff --git a/qcsrc/common/items/item/jetpack.qc b/qcsrc/common/items/item/jetpack.qc index d130b06cf..963f63dfa 100644 --- a/qcsrc/common/items/item/jetpack.qc +++ b/qcsrc/common/items/item/jetpack.qc @@ -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" ) diff --git a/qcsrc/common/items/item/powerup.qc b/qcsrc/common/items/item/powerup.qc index 9100e0bb3..ca54fa73f 100644 --- a/qcsrc/common/items/item/powerup.qc +++ b/qcsrc/common/items/item/powerup.qc @@ -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" diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh index 0ad822939..8fe729e7f 100644 --- a/qcsrc/common/util-pre.qh +++ b/qcsrc/common/util-pre.qh @@ -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; } diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 14a8c6bcb..d24a4688b 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -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"