]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Setting the cvar to 2 makes all items physical, including placed map items. Not recom...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 4 Apr 2012 13:18:01 +0000 (16:18 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 4 Apr 2012 13:18:01 +0000 (16:18 +0300)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_physical_weapons.qc

index 6be29e7401d23455022c5d7e14553b878104b527..adafe307006c775b394704b874c3a5957c6fa700 100644 (file)
@@ -1387,8 +1387,8 @@ alias sethostname "set menu_use_default_hostname 0; hostname $*"
 
 set sv_foginterval 1 "force enable fog in regular intervals"
 
-set g_ode_weapons 1 "use ODE physics instead of simple physics for dropped weapons, requires physics_ode to be enabled"
-set g_ode_weapons_damageforcescale 3 "how affected physical weapons are by damage"
+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"
 
 // Audio track names (for old-style "cd loop NUMBER" usage)
 set _cdtrack_first "1"
index e4c99f9ffa29a34fd05f6e034a2124d3c98acfea..0e77e6091c38f5b6a6245c97dce952203c6f969d 100644 (file)
@@ -1216,5 +1216,5 @@ float autocvar_g_sandbox_object_material_velocity_min;
 float autocvar_g_sandbox_object_material_velocity_factor;
 float autocvar_g_max_info_autoscreenshot;
 float autocvar_physics_ode;
-float autocvar_g_ode_weapons;
-float autocvar_g_ode_weapons_damageforcescale;
+float autocvar_g_ode_items;
+float autocvar_g_ode_items_damageforcescale;
index 6598468f4b680a88f0273cfe0ae5165ff2de48e1..0608977e8af5dac0423e39e2b92800225a313274 100644 (file)
@@ -1078,7 +1078,7 @@ void readlevelcvars(void)
                MUTATOR_ADD(mutator_vampire);
        if(cvar("g_spawn_near_teammate"))
                MUTATOR_ADD(mutator_spawn_near_teammate);
-       if(cvar("g_ode_weapons"))
+       if(cvar("g_ode_items"))
                MUTATOR_ADD(mutator_physical_weapons);
 
        // is this a mutator? is this a mode?
index 2ec984c89c09819a9f31279a8f6cb671e23aa668..92a3fb7a375b1112901c2fa15dfa89e09f3bc674 100644 (file)
@@ -7,9 +7,7 @@ void thrown_wep_ode_think()
 
 MUTATOR_HOOKFUNCTION(item_spawning)
 {
-       if(!autocvar_physics_ode)
-               return FALSE;
-       if(self.classname != "droppedweapon")
+       if(self.classname != "droppedweapon" && autocvar_g_ode_items <= 1)
                return FALSE;
 
        // make the dropped weapon physical
@@ -25,7 +23,7 @@ MUTATOR_HOOKFUNCTION(item_spawning)
        wep.solid = SOLID_CORPSE;
        wep.movetype = MOVETYPE_PHYSICS;
        wep.takedamage = DAMAGE_AIM;
-       wep.damageforcescale = autocvar_g_ode_weapons_damageforcescale;
+       wep.damageforcescale = autocvar_g_ode_items_damageforcescale;
 
        wep.think = thrown_wep_ode_think;
        wep.nextthink = time;
@@ -39,6 +37,9 @@ MUTATOR_HOOKFUNCTION(item_spawning)
 
 MUTATOR_DEFINITION(mutator_physical_weapons)
 {
+       if(!autocvar_physics_ode)
+               return FALSE;
+
        MUTATOR_HOOK(Item_Spawn, item_spawning, CBC_ORDER_ANY);
 
        return FALSE;