mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-20 19:12:03 +00:00
sv_user.c: partially revert svn commit r182, move wishdir and wishspeed
from global to local context, and pass them as params to SV_Accelerate() and SV_AirAccelerate(). git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1309 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
aa5e79f86a
commit
45465e4671
1 changed files with 7 additions and 10 deletions
|
@ -31,9 +31,6 @@ extern cvar_t sv_stopspeed;
|
||||||
|
|
||||||
static vec3_t forward, right, up;
|
static vec3_t forward, right, up;
|
||||||
|
|
||||||
vec3_t wishdir;
|
|
||||||
float wishspeed;
|
|
||||||
|
|
||||||
// world
|
// world
|
||||||
float *angles;
|
float *angles;
|
||||||
float *origin;
|
float *origin;
|
||||||
|
@ -168,7 +165,7 @@ SV_Accelerate
|
||||||
*/
|
*/
|
||||||
cvar_t sv_maxspeed = {"sv_maxspeed", "320", CVAR_NOTIFY|CVAR_SERVERINFO};
|
cvar_t sv_maxspeed = {"sv_maxspeed", "320", CVAR_NOTIFY|CVAR_SERVERINFO};
|
||||||
cvar_t sv_accelerate = {"sv_accelerate", "10", CVAR_NONE};
|
cvar_t sv_accelerate = {"sv_accelerate", "10", CVAR_NONE};
|
||||||
void SV_Accelerate (void)
|
void SV_Accelerate (float wishspeed, const vec3_t wishdir)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float addspeed, accelspeed, currentspeed;
|
float addspeed, accelspeed, currentspeed;
|
||||||
|
@ -185,7 +182,7 @@ void SV_Accelerate (void)
|
||||||
velocity[i] += accelspeed*wishdir[i];
|
velocity[i] += accelspeed*wishdir[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
void SV_AirAccelerate (vec3_t wishveloc)
|
void SV_AirAccelerate (float wishspeed, vec3_t wishveloc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float addspeed, wishspd, accelspeed, currentspeed;
|
float addspeed, wishspd, accelspeed, currentspeed;
|
||||||
|
@ -229,8 +226,7 @@ void SV_WaterMove (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
vec3_t wishvel;
|
vec3_t wishvel;
|
||||||
float speed, newspeed, addspeed, accelspeed;
|
float speed, newspeed, wishspeed, addspeed, accelspeed;
|
||||||
//float wishspeed;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// user intentions
|
// user intentions
|
||||||
|
@ -329,7 +325,8 @@ SV_AirMove
|
||||||
void SV_AirMove (void)
|
void SV_AirMove (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
vec3_t wishvel;
|
vec3_t wishvel, wishdir;
|
||||||
|
float wishspeed;
|
||||||
float fmove, smove;
|
float fmove, smove;
|
||||||
|
|
||||||
AngleVectors (sv_player->v.angles, forward, right, up);
|
AngleVectors (sv_player->v.angles, forward, right, up);
|
||||||
|
@ -364,11 +361,11 @@ void SV_AirMove (void)
|
||||||
else if ( onground )
|
else if ( onground )
|
||||||
{
|
{
|
||||||
SV_UserFriction ();
|
SV_UserFriction ();
|
||||||
SV_Accelerate ();
|
SV_Accelerate (wishspeed, wishdir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // not on ground, so little effect on velocity
|
{ // not on ground, so little effect on velocity
|
||||||
SV_AirAccelerate (wishvel);
|
SV_AirAccelerate (wishspeed, wishvel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue