]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean spawning up a little too
authorSamual Lenks <samual@xonotic.org>
Wed, 11 Dec 2013 04:44:00 +0000 (23:44 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 11 Dec 2013 04:44:00 +0000 (23:44 -0500)
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/throwing.qc

index 95e8b91291b402fe5f8e2a94043e282f19a0fd19..94d6d2135a9ee70cc3781e4da6fb10d78b8784fb 100644 (file)
@@ -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)
        {
index bc64b73713aa83dd25700815c4af2a141ebc17c2..7ac461969c102574bc076a4ea98242665a6964a7 100644 (file)
@@ -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;
        }
 }