From e4ffa27cd41c72fb981e441aaafb8ad7b669ce11 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Mon, 16 Oct 2017 12:37:26 +0300 Subject: [PATCH] Removed replacedweapon. --- .../mutators/mutator/random_items/sv_random_items.qc | 8 -------- qcsrc/server/weapons/spawning.qc | 6 ++++-- 2 files changed, 4 insertions(+), 10 deletions(-) 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 b971ac1dc..2e976a8be 100644 --- a/qcsrc/common/mutators/mutator/random_items/sv_random_items.qc +++ b/qcsrc/common/mutators/mutator/random_items/sv_random_items.qc @@ -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 ""; } diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index c1ff4e021..d47351cb3 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -7,6 +7,8 @@ #include #include +.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; } -- 2.39.2