]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
cleanup weapon_defaultspawnfunc
authorMartin Taibr <taibr.martin@gmail.com>
Sun, 25 Aug 2019 19:46:43 +0000 (21:46 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Sun, 25 Aug 2019 19:46:43 +0000 (21:46 +0200)
qcsrc/server/weapons/spawning.qc

index 0922b50d9687c3fd75fb69d48277ef6b6b354bcb..23a3ee67d6aa5ab8d2ba95d302f2b7514ecbdc39 100644 (file)
@@ -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 == "")
                {