From: Mircea Kitsune Date: Wed, 4 Apr 2012 16:44:45 +0000 (+0300) Subject: Reset an item if it fell off the map (eg: in lava) X-Git-Tag: xonotic-v0.7.0~111^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=365013f5b53a1cbb2463e94fc6bcb0dadf515481;p=xonotic%2Fxonotic-data.pk3dir.git Reset an item if it fell off the map (eg: in lava) --- 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;