r2437 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue May 1 17:05:43 EDT 2007
Author: div0
Date: 2007-05-01 17:05:43 -0400 (Tue, 01 May 2007)
New Revision: 2437
Modified:
trunk/data/qcsrc/server/cl_impulse.qc
trunk/data/qcsrc/server/cl_weaponsystem.qc
Log:
make weapon throwing use physics styles
Modified: trunk/data/qcsrc/server/cl_impulse.qc
===================================================================
--- trunk/data/qcsrc/server/cl_impulse.qc 2007-05-01 21:04:59 UTC (rev 2436)
+++ trunk/data/qcsrc/server/cl_impulse.qc 2007-05-01 21:05:43 UTC (rev 2437)
@@ -118,7 +118,7 @@
if (self.weapon != WEP_LASER
&& !cvar("g_minstagib") && !cvar("g_instagib")
&& !cvar("g_rocketarena") && !cvar("g_lms") && cvar("g_pickup_items") && !cvar("g_nixnex"))
- W_ThrowWeapon(self.velocity * 0.5 + v_forward * 750, '0 0 0', TRUE);
+ W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750), '0 0 0', TRUE);
}
}
// deploy waypoints
Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc 2007-05-01 21:04:59 UTC (rev 2436)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc 2007-05-01 21:05:43 UTC (rev 2437)
@@ -411,20 +411,14 @@
// VorteX: haste can be added here
};
-void(entity missile) W_SetupProjectileVelocity =
+vector(vector pvelocity, vector mvelocity) W_CalculateProjectileVelocity =
{
- vector pvelocity;
vector mdirection;
float mspeed;
float outspeed;
float nstyle;
- vector mvelocity;
vector outvelocity;
- if(missile.owner == world)
- error("Unowned missile");
- pvelocity = missile.owner.velocity;
- mvelocity = missile.velocity;
mdirection = normalize(mvelocity);
mspeed = vlen(mvelocity);
@@ -485,7 +479,13 @@
else
error("g_projectiles_newton_style must be 0 (absolute), 1 (Newtonian), 2 (Newtonian + aimfix), 3 (pseudo Newtonian) or 4 (tZorkian)!");
- //dprint("Adjusted from ", vtos(missile.velocity));
- missile.velocity = outvelocity;
- //dprint(" to ", vtos(missile.velocity), "\n");
+ return outvelocity;
}
+
+void(entity missile) W_SetupProjectileVelocity =
+{
+ if(missile.owner == world)
+ error("Unowned missile");
+
+ missile.velocity = W_CalculateProjectileVelocity(missile.owner.velocity, missile.velocity);
+}
More information about the nexuiz-commits
mailing list