From: Mircea Kitsune Date: Wed, 4 Apr 2012 19:33:15 +0000 (+0300) Subject: More name correction and also make items that fall into lava and slime return to... X-Git-Tag: xonotic-v0.7.0~111^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e13b404cae02faad07d65ad29fac1d9e7b7ff0f3;p=xonotic%2Fxonotic-data.pk3dir.git More name correction and also make items that fall into lava and slime return to spawn --- diff --git a/qcsrc/server/mutators/mutator_physical_items.qc b/qcsrc/server/mutators/mutator_physical_items.qc index e362b11f41..7c39772aed 100644 --- a/qcsrc/server/mutators/mutator_physical_items.qc +++ b/qcsrc/server/mutators/mutator_physical_items.qc @@ -1,6 +1,6 @@ .vector spawn_origin, spawn_angles; -void thrown_wep_ode_think() +void physical_item_think() { self.nextthink = time; @@ -35,7 +35,7 @@ void thrown_wep_ode_think() remove(self); // the real weapon is gone, remove this } -void thrown_wep_ode_touch() +void physical_item_touch() { if(!self.cnt) // not for dropped items if (ITEM_TOUCH_NEEDKILL()) @@ -45,6 +45,16 @@ void thrown_wep_ode_touch() } } +void physical_item_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) +{ + if(!self.cnt) // not for dropped items + if(ITEM_DAMAGE_NEEDKILL(deathtype)) + { + setorigin(self, self.spawn_origin); + self.angles = self.spawn_angles; + } +} + MUTATOR_HOOKFUNCTION(item_spawning) { if(self.owner == world && autocvar_g_ode_items <= 1) @@ -73,9 +83,10 @@ MUTATOR_HOOKFUNCTION(item_spawning) wep.dphitcontentsmask = self.dphitcontentsmask; wep.cnt = (self.owner != world); - wep.think = thrown_wep_ode_think; + wep.think = physical_item_think; wep.nextthink = time; - wep.touch = thrown_wep_ode_touch; + wep.touch = physical_item_touch; + wep.event_damage = physical_item_damage; wep.spawn_origin = self.origin; wep.spawn_angles = self.angles;