From: Lyberta Date: Fri, 10 Nov 2017 06:07:57 +0000 (+0300) Subject: Random items: Removing more useless macros. X-Git-Tag: xonotic-v0.8.5~2426^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e607b88117bf855c3b65fca166006de217d62551;p=xonotic%2Fxonotic-data.pk3dir.git Random items: Removing more useless macros. --- diff --git a/qcsrc/common/mutators/mutator/random_items/sv_random_items.qc b/qcsrc/common/mutators/mutator/random_items/sv_random_items.qc index 2d96ae62c..648b6b9f2 100644 --- a/qcsrc/common/mutators/mutator/random_items/sv_random_items.qc +++ b/qcsrc/common/mutators/mutator/random_items/sv_random_items.qc @@ -196,18 +196,16 @@ string RandomItems_GetRandomMapItemClassName() return RandomItems_GetRandomOverkillMapItemClassName(); } RandomSelection_Init(); - #define X(type, name) \ - RandomSelection_AddFloat( \ - RANDOM_ITEM_TYPE_##type, \ - autocvar_g_random_items_##name##_probability, \ - 1 \ - ) - X(HEALTH, health); - X(ARMOR, armor); - X(RESOURCE, resource); - X(WEAPON, weapon); - X(POWERUP, powerup); - #undef X + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_HEALTH, + autocvar_g_random_items_health_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_ARMOR, + autocvar_g_random_items_armor_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_RESOURCE, + autocvar_g_random_items_resource_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_WEAPON, + autocvar_g_random_items_weapon_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_POWERUP, + autocvar_g_random_items_powerup_probability, 1); int item_type = RandomSelection_chosen_float; switch (item_type) { @@ -406,18 +404,16 @@ string RandomItems_GetRandomLootItemClassName() return RandomItems_GetRandomOverkillLootItemClassName(); } RandomSelection_Init(); - #define X(type, name) \ - RandomSelection_AddFloat( \ - RANDOM_ITEM_TYPE_##type, \ - autocvar_g_random_loot_##name##_probability, \ - 1 \ - ) - X(HEALTH, health); - X(ARMOR, armor); - X(RESOURCE, resource); - X(WEAPON, weapon); - X(POWERUP, powerup); - #undef X + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_HEALTH, + autocvar_g_random_loot_health_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_ARMOR, + autocvar_g_random_loot_armor_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_RESOURCE, + autocvar_g_random_loot_resource_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_WEAPON, + autocvar_g_random_loot_weapon_probability, 1); + RandomSelection_AddFloat(RANDOM_ITEM_TYPE_POWERUP, + autocvar_g_random_loot_powerup_probability, 1); int item_type = RandomSelection_chosen_float; switch (item_type) {