]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Random items: Removing more useless macros.
authorLyberta <lyberta@lyberta.net>
Fri, 10 Nov 2017 06:07:57 +0000 (09:07 +0300)
committerLyberta <lyberta@lyberta.net>
Fri, 10 Nov 2017 06:07:57 +0000 (09:07 +0300)
qcsrc/common/mutators/mutator/random_items/sv_random_items.qc

index 2d96ae62cfc642f53379d30546480608223d7648..648b6b9f2892255b8f810c34d48648836c002fc1 100644 (file)
@@ -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)
        {