From: Mario Date: Sun, 30 Aug 2015 12:41:50 +0000 (+1000) Subject: Fix physical items X-Git-Tag: xonotic-v0.8.2~1953 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af9b212dba13c693a393cadc51749bfeaab03c67;p=xonotic%2Fxonotic-data.pk3dir.git Fix physical items --- 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; }