From: Mircea Kitsune Date: Wed, 4 Apr 2012 14:16:32 +0000 (+0300) Subject: Cvar resetting of picked up items X-Git-Tag: xonotic-v0.7.0~111^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e33912f371b21750b06d543aa69c4bbdb17ffc0d;p=xonotic%2Fxonotic-data.pk3dir.git Cvar resetting of picked up items --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index adafe30700..5e7d41eea4 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1389,6 +1389,7 @@ set sv_foginterval 1 "force enable fog in regular intervals" set g_ode_items 2 "1 uses ODE physics for dropped weapons, 2 for all items, requires physics_ode to be enabled" set g_ode_items_damageforcescale 3 "how affected physical weapons are by damage" +set g_ode_items_reset 1 "return map items to their original lotation after being picked up" // Audio track names (for old-style "cd loop NUMBER" usage) set _cdtrack_first "1" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 0e77e6091c..8ec28c0f7a 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -1218,3 +1218,4 @@ float autocvar_g_max_info_autoscreenshot; float autocvar_physics_ode; float autocvar_g_ode_items; float autocvar_g_ode_items_damageforcescale; +float autocvar_g_ode_items_reset; diff --git a/qcsrc/server/mutators/mutator_physical_weapons.qc b/qcsrc/server/mutators/mutator_physical_weapons.qc index 88cf9c5d3b..37c9c7c8dd 100644 --- a/qcsrc/server/mutators/mutator_physical_weapons.qc +++ b/qcsrc/server/mutators/mutator_physical_weapons.qc @@ -14,17 +14,20 @@ void thrown_wep_ode_think() self.glowmod = self.owner.glowmod; // if the item is not spawned, make sure the invisible / ghost item returns to its origin and stays there - if(self.owner.nextthink > time) // awaiting respawn + if(autocvar_g_ode_items_reset) { - setorigin(self, self.spawn_origin); - self.angles = self.spawn_angles; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - } - else - { - self.solid = SOLID_CORPSE; - self.movetype = MOVETYPE_PHYSICS; + if(self.owner.nextthink > time) // awaiting respawn + { + setorigin(self, self.spawn_origin); + self.angles = self.spawn_angles; + self.solid = SOLID_NOT; + self.movetype = MOVETYPE_NONE; + } + else + { + self.solid = SOLID_CORPSE; + self.movetype = MOVETYPE_PHYSICS; + } } }