]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Random items: Removed more macros.
authorLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 12:05:09 +0000 (15:05 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 12:05:09 +0000 (15:05 +0300)
qcsrc/common/mutators/mutator/random_items/sv_random_items.qc

index ad0d49c2cad14cee909a6581ba05498b3950b4c7..eb3696c335aa557f008e6e66a989b7c56a337f8c 100644 (file)
@@ -221,7 +221,7 @@ string RandomItems_GetRandomMapItemClassName()
                        {
                                RandomSelection_AddString(it.m_canonical_spawnfunc,
                                        cvar(sprintf("g_random_items_%s_probability",
-                                       RandomItems_GetItemVarName(it.m_canonical_spawnfunc))), 1);
+                                       it.m_canonical_spawnfunc)), 1);
                        });
                        return RandomSelection_chosen_string;
                }
@@ -232,7 +232,7 @@ string RandomItems_GetRandomMapItemClassName()
                        {
                                RandomSelection_AddString(it.m_canonical_spawnfunc,
                                        cvar(sprintf("g_random_items_%s_probability",
-                                       RandomItems_GetItemVarName(it.m_canonical_spawnfunc))), 1);
+                                       it.m_canonical_spawnfunc)), 1);
                        });
                        return RandomSelection_chosen_string;
                }
@@ -243,7 +243,7 @@ string RandomItems_GetRandomMapItemClassName()
                        {
                                RandomSelection_AddString(it.m_canonical_spawnfunc,
                                        cvar(sprintf("g_random_items_%s_probability",
-                                       RandomItems_GetItemVarName(it.m_canonical_spawnfunc))), 1);
+                                       it.m_canonical_spawnfunc)), 1);
                        });
                        return RandomSelection_chosen_string;
                }
@@ -268,7 +268,7 @@ string RandomItems_GetRandomMapItemClassName()
                        #define X(classname) \
                                RandomSelection_AddString( \
                                        classname, \
-                                       cvar(sprintf("g_random_items_%s_probability", RandomItems_GetItemVarName(classname))), \
+                                       cvar(sprintf("g_random_items_%s_probability", classname)), \
                                        1 \
                                )
                        X("item_strength");
@@ -429,46 +429,34 @@ string RandomItems_GetRandomLootItemClassName()
                case RANDOM_ITEM_TYPE_HEALTH:
                {
                        RandomSelection_Init();
-                       #define X(classname) \
-                               RandomSelection_AddString( \
-                                       classname, \
-                                       cvar(sprintf("g_random_loot_%s_probability", RandomItems_GetItemVarName(classname))), \
-                                       1 \
-                               )
-                       FOREACH(Items, it.instanceOfHealth, {
-                               X(sprintf("item_%s", it.netname));
+                       FOREACH(Items, it.instanceOfHealth,
+                       {
+                               RandomSelection_AddString(it.m_canonical_spawnfunc,
+                                       cvar(sprintf("g_random_loot_%s_probability",
+                                       it.m_canonical_spawnfunc)), 1);
                        });
-                       #undef X
                        return RandomSelection_chosen_string;
                }
                case RANDOM_ITEM_TYPE_ARMOR:
                {
                        RandomSelection_Init();
-                       #define X(classname) \
-                               RandomSelection_AddString( \
-                                       classname, \
-                                       cvar(sprintf("g_random_loot_%s_probability", RandomItems_GetItemVarName(classname))), \
-                                       1 \
-                               )
-                       FOREACH(Items, it.instanceOfArmor, {
-                               X(sprintf("item_%s", it.netname));
+                       FOREACH(Items, it.instanceOfArmor,
+                       {
+                               RandomSelection_AddString(it.m_canonical_spawnfunc,
+                                       cvar(sprintf("g_random_loot_%s_probability",
+                                       it.m_canonical_spawnfunc)), 1);
                        });
-                       #undef X
                        return RandomSelection_chosen_string;
                }
                case RANDOM_ITEM_TYPE_RESOURCE:
                {
                        RandomSelection_Init();
-                       #define X(classname) \
-                               RandomSelection_AddString( \
-                                       classname, \
-                                       cvar(sprintf("g_random_loot_%s_probability", RandomItems_GetItemVarName(classname))), \
-                                       1 \
-                               )
-                       FOREACH(Items, it.instanceOfAmmo, {
-                               X(sprintf("item_%s", it.netname));
+                       FOREACH(Items, it.instanceOfAmmo,
+                       {
+                               RandomSelection_AddString(it.m_canonical_spawnfunc,
+                                       cvar(sprintf("g_random_loot_%s_probability",
+                                       it.m_canonical_spawnfunc)), 1);
                        });
-                       #undef X
                        return RandomSelection_chosen_string;
                }
                case RANDOM_ITEM_TYPE_WEAPON:
@@ -493,7 +481,7 @@ string RandomItems_GetRandomLootItemClassName()
                        #define X(classname) \
                                RandomSelection_AddString( \
                                        classname, \
-                                       cvar(sprintf("g_random_loot_%s_probability", RandomItems_GetItemVarName(classname))), \
+                                       cvar(sprintf("g_random_loot_%s_probability", classname)), \
                                        1 \
                                )
                        X("item_strength");