From bfb4ad5acf6d396b3d92575d025152613352323d Mon Sep 17 00:00:00 2001
From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Tue, 3 Apr 2012 23:44:45 +0300
Subject: [PATCH] Make the fake physical weapon disappear after the dropped one
 has.

---
 qcsrc/server/cl_weapons.qc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc
index 12f4151766..c62067b2c4 100644
--- a/qcsrc/server/cl_weapons.qc
+++ b/qcsrc/server/cl_weapons.qc
@@ -186,6 +186,14 @@ void thrown_wep_think()
 		SUB_VanishOrRemove(self);
 }
 
+void thrown_wep_ode_think()
+{
+	self.nextthink = time;
+	self.alpha = self.owner.alpha; // apply fading of the original weapon
+	if(!self.owner.modelindex)
+		remove(self); // the real weapon is gone, remove this
+}
+
 // returns amount of ammo used as string, or -1 for failure, or 0 for no ammo count
 string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo)
 {
@@ -320,10 +328,12 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
 			wep2.takedamage = DAMAGE_AIM;
 			wep2.colormap = wep.colormap;
 			wep2.glowmod = wep.glowmod;
+			wep2.damageforcescale = 3; // FIX!!!
 
-			wep2.damageforcescale = 3;
+			wep2.think = thrown_wep_ode_think;
+			wep2.nextthink = time;
 
-			wep.alpha = -1;
+			wep.model = "null"; // don't use setmodel, we want to keep the size
 			wep.movetype = MOVETYPE_FOLLOW;
 			wep.aiment = wep2;
 		}
-- 
2.39.5