From 365013f5b53a1cbb2463e94fc6bcb0dadf515481 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Wed, 4 Apr 2012 19:44:45 +0300 Subject: [PATCH] Reset an item if it fell off the map (eg: in lava) --- qcsrc/server/mutators/mutator_physical_weapons.qc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/mutators/mutator_physical_weapons.qc b/qcsrc/server/mutators/mutator_physical_weapons.qc index 489379b6ff..9d83e9a06b 100644 --- a/qcsrc/server/mutators/mutator_physical_weapons.qc +++ b/qcsrc/server/mutators/mutator_physical_weapons.qc @@ -35,6 +35,15 @@ void thrown_wep_ode_think() remove(self); // the real weapon is gone, remove this } +void thrown_wep_ode_touch() +{ + if (ITEM_TOUCH_NEEDKILL()) + { + setorigin(self, self.spawn_origin); + self.angles = self.spawn_angles; + } +} + MUTATOR_HOOKFUNCTION(item_spawning) { if(self.classname != "droppedweapon" && autocvar_g_ode_items <= 1) @@ -60,10 +69,12 @@ MUTATOR_HOOKFUNCTION(item_spawning) wep.colormap = self.owner.colormap; wep.glowmod = self.owner.glowmod; wep.damageforcescale = autocvar_g_ode_items_damageforcescale; + wep.dphitcontentsmask = self.dphitcontentsmask; + wep.cnt = (self.classname == "droppedweapon"); wep.think = thrown_wep_ode_think; wep.nextthink = time; - wep.cnt = (self.classname == "droppedweapon"); + wep.touch = thrown_wep_ode_touch; wep.spawn_origin = self.origin; wep.spawn_angles = self.angles; -- 2.39.2