]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
A try at making dropped weapons physical. Requires the ODE library for darkplaces...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 Apr 2012 20:28:06 +0000 (23:28 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 Apr 2012 20:28:06 +0000 (23:28 +0300)
qcsrc/server/cl_weapons.qc

index 94eaccd2daf4a4cc8a46b3afc9982c122b006e38..12f4151766069de3c8eac6eff03db6735cecf8f3 100644 (file)
@@ -302,6 +302,32 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                wep.savenextthink = wep.nextthink;
                wep.nextthink = min(wep.nextthink, time + 0.5);
                wep.pickup_anyway = TRUE; // these are ALWAYS pickable
+
+               // make the dropped weapon physical
+               //if(autocvar_sv_ode && autocvar_physics_ode)
+               {
+                       entity wep2;
+                       wep2 = spawn();
+                       setorigin(wep2, wep.origin);
+                       setmodel(wep2, wep.model);
+                       wep2.angles = wep.angles;
+                       wep2.velocity = velo;
+
+                       wep2.classname = "droppedweapon2";
+                       wep2.owner = wep;
+                       wep2.solid = SOLID_BBOX;
+                       wep2.movetype = MOVETYPE_PHYSICS;
+                       wep2.takedamage = DAMAGE_AIM;
+                       wep2.colormap = wep.colormap;
+                       wep2.glowmod = wep.glowmod;
+
+                       wep2.damageforcescale = 3;
+
+                       wep.alpha = -1;
+                       wep.movetype = MOVETYPE_FOLLOW;
+                       wep.aiment = wep2;
+               }
+
                return s;
        }
 }