]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Removed replacedweapon.
authorLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 09:37:26 +0000 (12:37 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 09:37:26 +0000 (12:37 +0300)
qcsrc/common/mutators/mutator/random_items/sv_random_items.qc
qcsrc/server/weapons/spawning.qc

index b971ac1dc58f5e4e4b48e5d5ffd0d6516759ed9c..2e976a8beb718a210076f92a29c15089f19e51cb 100644 (file)
@@ -137,14 +137,6 @@ string RandomItems_GetItemReplacementClassNames(entity item)
        {
                return cvar_string(sprintf("g_random_items_replace_%s", class_name));
        }
-       if (item.classname == "replacedweapon")
-       {
-               Weapon w = Weapons_from(item.weapon);
-               if (w != WEP_Null)
-               {
-                       return cvar_string(sprintf("g_random_items_replace_weapon_%s", w.netname));
-               }
-       }
        return "";
 }
 
index c1ff4e0217615a74a706a9153418c15310efbe69..d47351cb37a727aab87f100d2ccb61ddd98a5824 100644 (file)
@@ -7,6 +7,8 @@
 #include <server/items.qh>
 #include <common/weapons/_all.qh>
 
+.bool m_isreplaced; ///< Holds whether the weapon has been replaced.
+
 string W_Apply_Weaponreplace(string in)
 {
        string out = "";
@@ -29,7 +31,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e)
        Weapon wpn = e;
        e = wpn = wpn.m_spawnfunc_hookreplace(wpn, this);
        this.classname = wpn.m_canonical_spawnfunc;
-       if (!Item_IsLoot(this) && this.classname != "replacedweapon")
+       if (!Item_IsLoot(this) && !this.m_isreplaced)
        {
                if (e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                {
@@ -59,7 +61,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e)
                                        {
                                                entity replacement = spawn();
                                                copyentity(this, replacement);
-                                               replacement.classname = "replacedweapon";
+                                               replacement.m_isreplaced = true;
                                                weapon_defaultspawnfunc(replacement, it);
                                                break;
                                        }