From 7cbff355ba196ad1c10c9b4a908a51086249cbe7 Mon Sep 17 00:00:00 2001
From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Wed, 4 Apr 2012 16:42:33 +0300
Subject: [PATCH] Make the physical item visible and hide the trigger weapon
 instead

---
 qcsrc/server/mutators/mutator_physical_weapons.qc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/qcsrc/server/mutators/mutator_physical_weapons.qc b/qcsrc/server/mutators/mutator_physical_weapons.qc
index 92a3fb7a37..fa27a36a7a 100644
--- a/qcsrc/server/mutators/mutator_physical_weapons.qc
+++ b/qcsrc/server/mutators/mutator_physical_weapons.qc
@@ -10,27 +10,31 @@ MUTATOR_HOOKFUNCTION(item_spawning)
 	if(self.classname != "droppedweapon" && autocvar_g_ode_items <= 1)
 		return FALSE;
 
-	// make the dropped weapon physical
+	// The actual item can't be physical and trigger at the same time, so make it invisible and use a second entity for physics.
+	// Ugly hack, but unless SOLID_TRIGGER is gotten to work with MOVETYPE_PHYSICS in the engine it can't be fixed.
 	entity wep;
 	wep = spawn();
+	setmodel(wep, self.model);
 	setsize(wep, self.mins, self.maxs);
 	setorigin(wep, self.origin);
 	wep.angles = self.angles;
 	wep.velocity = self.velocity;
 
-	wep.classname = "droppedweapon2";
 	wep.owner = self;
 	wep.solid = SOLID_CORPSE;
 	wep.movetype = MOVETYPE_PHYSICS;
 	wep.takedamage = DAMAGE_AIM;
+	wep.effects |= EF_NOMODELFLAGS; // disable the spinning
+	wep.colormap = self.colormap;
+	wep.glowmod = self.glowmod;
 	wep.damageforcescale = autocvar_g_ode_items_damageforcescale;
 
 	wep.think = thrown_wep_ode_think;
 	wep.nextthink = time;
 
-	self.effects |= EF_NOMODELFLAGS; // disable the spinning
+	self.effects |= EF_NODRAW; // hide the original weapon
 	self.movetype = MOVETYPE_FOLLOW;
-	self.aiment = wep;
+	self.aiment = wep; // attach the original weapon
 
 	return FALSE;
 }
-- 
2.39.5