From: Martin Taibr Date: Sun, 25 Aug 2019 19:46:43 +0000 (+0200) Subject: cleanup weapon_defaultspawnfunc X-Git-Tag: xonotic-v0.8.5~1360^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0e10bd928710909a13978dc7dddbac84d1fed0f8;p=xonotic%2Fxonotic-data.pk3dir.git cleanup weapon_defaultspawnfunc --- diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 0922b50d9..23a3ee67d 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -26,22 +26,21 @@ string W_Apply_Weaponreplace(string in) return out; } -void weapon_defaultspawnfunc(entity this, Weapon e) +void weapon_defaultspawnfunc(entity this, Weapon wpn) { - Weapon wpn = e; // TODO unify wpn and e - e = wpn = wpn.m_spawnfunc_hookreplace(wpn, this); + 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) + if (wpn.spawnflags & WEP_FLAG_MUTATORBLOCKED) { LOG_WARNF("Attempted to spawn a mutator-blocked weapon rejected: prvm_edict server %i", this); startitem_failed = true; return; } - string s = W_Apply_Weaponreplace(e.netname); - MUTATOR_CALLHOOK(SetWeaponreplace, this, e, s); + string s = W_Apply_Weaponreplace(wpn.netname); + MUTATOR_CALLHOOK(SetWeaponreplace, this, wpn, s); s = M_ARGV(2, string); if (s == "") {