From: Lyberta Date: Mon, 16 Oct 2017 09:37:26 +0000 (+0300) Subject: Removed replacedweapon. X-Git-Tag: xonotic-v0.8.5~2426^2~22 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e4ffa27cd41c72fb981e441aaafb8ad7b669ce11;p=xonotic%2Fxonotic-data.pk3dir.git Removed replacedweapon. --- 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; }