From: Mircea Kitsune Date: Tue, 3 Apr 2012 20:28:06 +0000 (+0300) Subject: A try at making dropped weapons physical. Requires the ODE library for darkplaces... X-Git-Tag: xonotic-v0.7.0~111^2~28 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1682b9ed6b90aa31577ed8a03c8295aac58761ce;p=xonotic%2Fxonotic-data.pk3dir.git A try at making dropped weapons physical. Requires the ODE library for darkplaces and physics_ode to be enabled --- diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 94eaccd2da..12f4151766 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -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; } }