From 995a17ca8ab147707b8b371d4d53955dfa699d90 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Tue, 3 Apr 2012 23:56:25 +0300 Subject: [PATCH] Give dropped weapons a random anagular velocity. Doesn't work for some reason --- defaultXonotic.cfg | 1 + qcsrc/server/autocvars.qh | 1 + qcsrc/server/cl_weapons.qc | 3 +++ 3 files changed, 5 insertions(+) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index c3b2090dad..b697b18fe2 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 8738e04aa2..527f39822a 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_sv_physics_ode_droppedweapon; float autocvar_sv_physics_ode_droppedweapon_damageforcescale; +float autocvar_sv_physics_ode_droppedweapon_avelocity; diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 031c5d0591..53f39525f7 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -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; -- 2.39.2