]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give dropped weapons a random anagular velocity. Doesn't work for some reason
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 Apr 2012 20:56:25 +0000 (23:56 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 Apr 2012 20:56:25 +0000 (23:56 +0300)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/cl_weapons.qc

index c3b2090dada4aced277169e105d04f88b1055d09..b697b18fe2023c67de38c3d4f9ce3f464a18acde 100644 (file)
@@ -1389,6 +1389,7 @@ set sv_foginterval 1 "force enable fog in regular intervals"
 
 set sv_physics_ode_droppedweapon 1 "use ODE physics instead of simple physics for dropped weapons, requires physics_ode to be enabled"
 set sv_physics_ode_droppedweapon_damageforcescale 3 "how affected physical weapons are by damage"
+set sv_physics_ode_droppedweapon_avelocity 2 "randomized anagular velocity given to the weapon when dropping"
 
 // Audio track names (for old-style "cd loop NUMBER" usage)
 set _cdtrack_first "1"
index 8738e04aa21606ecc0c28718e16c98241cfdcdd7..527f39822a14925fab8c348ef341c09506c0eb0d 100644 (file)
@@ -1218,3 +1218,4 @@ float autocvar_g_max_info_autoscreenshot;
 float autocvar_physics_ode;
 float autocvar_sv_physics_ode_droppedweapon;
 float autocvar_sv_physics_ode_droppedweapon_damageforcescale;
+float autocvar_sv_physics_ode_droppedweapon_avelocity;
index 031c5d0591940130b0c474edc41c6b655508c7bb..53f39525f77e8d25b23b834052e92de1762e24b2 100644 (file)
@@ -320,6 +320,9 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                        setmodel(wep2, wep.model);
                        wep2.angles = wep.angles;
                        wep2.velocity = velo;
+                       wep2.avelocity_x = random() * autocvar_sv_physics_ode_droppedweapon_avelocity;
+                       wep2.avelocity_y = random() * autocvar_sv_physics_ode_droppedweapon_avelocity;
+                       wep2.avelocity_z = random() * autocvar_sv_physics_ode_droppedweapon_avelocity;
 
                        wep2.classname = "droppedweapon2";
                        wep2.owner = wep;