From af9b212dba13c693a393cadc51749bfeaab03c67 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 30 Aug 2015 22:41:50 +1000 Subject: [PATCH] Fix physical items --- .../server/mutators/mutator_physical_items.qc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/mutators/mutator_physical_items.qc b/qcsrc/server/mutators/mutator_physical_items.qc index 08bb81a9f..0ee697d26 100644 --- a/qcsrc/server/mutators/mutator_physical_items.qc +++ b/qcsrc/server/mutators/mutator_physical_items.qc @@ -20,15 +20,17 @@ void physical_item_think() // if the item is not spawned, make sure the invisible / ghost item returns to its origin and stays there if(autocvar_g_physical_items_reset) { - if(self.owner.nextthink > time) // awaiting respawn + if(self.owner.wait > time) // awaiting respawn { setorigin(self, self.spawn_origin); self.angles = self.spawn_angles; self.solid = SOLID_NOT; + self.alpha = -1; self.movetype = MOVETYPE_NONE; } else { + self.alpha = 1; self.solid = SOLID_CORPSE; self.movetype = MOVETYPE_PHYSICS; } @@ -92,12 +94,24 @@ MUTATOR_HOOKFUNCTION(item_spawning) wep.touch = physical_item_touch; wep.event_damage = physical_item_damage; - wep.spawn_origin = self.origin; + if(!wep.cnt) + { + // fix the spawn origin + setorigin(wep, wep.origin + '0 0 1'); + entity oldself; + oldself = self; + self = wep; + builtin_droptofloor(); + self = oldself; + } + + wep.spawn_origin = wep.origin; wep.spawn_angles = self.angles; self.effects |= EF_NODRAW; // hide the original weapon self.movetype = MOVETYPE_FOLLOW; self.aiment = wep; // attach the original weapon + self.SendEntity = func_null; return false; } -- 2.39.2