X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fspawning.qc;h=d47351cb37a727aab87f100d2ccb61ddd98a5824;hb=b945d959784e5b249c66aea4f3326d8ae048f1cd;hp=d5b78aa1cd064424b267ca3cfc2ce7c782714d09;hpb=2dbcd3c5a4a458b9e83f3b037ca1d951f73755c3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index d5b78aa1c..d47351cb3 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -4,8 +4,11 @@ #include "../resources.qh" #include "../mutators/_mod.qh" #include +#include #include +.bool m_isreplaced; ///< Holds whether the weapon has been replaced. + string W_Apply_Weaponreplace(string in) { string out = ""; @@ -26,7 +29,9 @@ string W_Apply_Weaponreplace(string in) void weapon_defaultspawnfunc(entity this, Weapon e) { Weapon wpn = e; - if (this.classname != "droppedweapon" && this.classname != "replacedweapon") + e = wpn = wpn.m_spawnfunc_hookreplace(wpn, this); + this.classname = wpn.m_canonical_spawnfunc; + if (!Item_IsLoot(this) && !this.m_isreplaced) { if (e.spawnflags & WEP_FLAG_MUTATORBLOCKED) { @@ -56,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; }