From 4dd70b3ad7d18bbd8d4877115600e3d037cf46f8 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Tue, 10 Dec 2013 23:44:00 -0500 Subject: [PATCH] Clean spawning up a little too --- qcsrc/server/weapons/spawning.qc | 6 ----- qcsrc/server/weapons/throwing.qc | 39 +++++++++++--------------------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 95e8b9129..94d6d2135 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -17,10 +17,6 @@ string W_Apply_Weaponreplace(string in) replacement = e.weaponreplace; } } - - //if(replacement != "") { out = sprintf("%s %s", out, replacement); } - //else if(replacement != "0") { out = sprintf("%s %s", out, replacement); } - //else { out = sprintf("%s %s", out, argv(i)); } if(replacement == "") out = strcat(out, " ", s); @@ -147,8 +143,6 @@ void weapon_defaultspawnfunc(float wpn) } } - print(sprintf("defaultspawnfunc: current ammo count: %f\n", self.(e.current_ammo))); - #if 0 if(e.items) { diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index bc64b7371..7ac461969 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -61,31 +61,27 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto } } + oldself = self; + self = wep; + weapon_defaultspawnfunc(wpn); + self = oldself; + if(startitem_failed) + return string_null; + wep.glowmod = own.weaponentity_glowmod; + wep.think = thrown_wep_think; + wep.savenextthink = wep.nextthink; + wep.nextthink = min(wep.nextthink, time + 0.5); + wep.pickup_anyway = TRUE; // these are ALWAYS pickable + //wa = W_AmmoItemCode(wpn); if(ammofield == ammo_none) { - oldself = self; - self = wep; - weapon_defaultspawnfunc(wpn); - self = oldself; - if(startitem_failed) - return string_null; - wep.glowmod = own.weaponentity_glowmod; - wep.think = thrown_wep_think; - wep.savenextthink = wep.nextthink; - wep.nextthink = min(wep.nextthink, time + 0.5); - wep.pickup_anyway = TRUE; // these are ALWAYS pickable return ""; } else { s = ""; - oldself = self; - self = wep; - weapon_defaultspawnfunc(wpn); - self = oldself; - if(startitem_failed) - return string_null; + if(doreduce && g_weapon_stay == 2) { // if our weapon is loaded, give its load back to the player @@ -106,13 +102,10 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading } - // stuff thisammo = min(own.ammofield, wep.ammofield); wep.ammofield = thisammo; own.ammofield -= thisammo; - //print(sprintf("W_ThrowNewWeapon: wep ammo count: %f, own ammo count: %f, thisammo = %f\n", wep.ammofield, own.ammofield, thisammo)); - switch(ammofield) { case ammo_shells: s = sprintf("%s and %d shells", s, thisammo); break; @@ -124,12 +117,6 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto s = substring(s, 5, -1); } - wep.glowmod = own.weaponentity_glowmod; - wep.think = thrown_wep_think; - wep.savenextthink = wep.nextthink; - wep.nextthink = min(wep.nextthink, time + 0.5); - wep.pickup_anyway = TRUE; // these are ALWAYS pickable - return s; } } -- 2.39.2