From 69635b211c59faf9a291a9f25c53d91d130cd1e8 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Wed, 4 Apr 2012 16:54:09 +0300 Subject: [PATCH] Copy ghost items effect on physical map items --- .../mutators/mutator_physical_weapons.qc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/mutators/mutator_physical_weapons.qc b/qcsrc/server/mutators/mutator_physical_weapons.qc index cbfc579018..440135996a 100644 --- a/qcsrc/server/mutators/mutator_physical_weapons.qc +++ b/qcsrc/server/mutators/mutator_physical_weapons.qc @@ -1,14 +1,28 @@ void thrown_wep_ode_think() { self.nextthink = time; + + self.alpha = self.owner.alpha; // apply fading and ghosting + + if(!self.cnt) // map item, not dropped weapon + { + // copy ghost item properties + self.colormap = self.owner.colormap; + self.colormod = self.owner.colormod; + self.glowmod = self.owner.glowmod; + } + if(!self.owner.modelindex) remove(self); // the real weapon is gone, remove this } MUTATOR_HOOKFUNCTION(item_spawning) { - if(self.classname != "droppedweapon" && autocvar_g_ode_items <= 1) - return FALSE; + if(self.classname != "droppedweapon") + { + if(autocvar_g_ode_items <= 1) + return FALSE; + } // 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. @@ -31,6 +45,7 @@ MUTATOR_HOOKFUNCTION(item_spawning) wep.think = thrown_wep_ode_think; wep.nextthink = time; + wep.cnt = (self.classname == "droppedweapon"); self.effects |= EF_NODRAW; // hide the original weapon self.movetype = MOVETYPE_FOLLOW; -- 2.39.2