void QPM_AirMove( void )
{
int i;
vec3_t wishvel;
float fmove, smove;
vec3_t wishdir;
float wishspeed;
fmove = pm->cmd.forwardmove;
smove = pm->cmd.rightmove;
pml.forward[2] = 0;
pml.right[2] = 0;
VectorNormalize( pml.forward );
VectorNormalize( pml.right );
for( i = 0; i < 2; i++ )
wishvel[i] = pml.forward[i]*fmove + pml.right[i]*smove; //Smooth
wishvel[2] = 0;
VectorCopy( wishvel, wishdir );
wishspeed = VectorNormalize( wishdir);
/* Disabled, but here just in case I need it.
if(wishspeed > 2000)
{
VectorScale( wishvel, 2000/wishspeed, wishvel );
wishspeed = 2000;
}*/
if(pm->ps->groundEntityNum != ENTITYNUM_NONE)
{
pm->ps->velocity[2] = 0;
PM_Accelerate( wishdir, wishspeed, pm_accelerate );
pm->ps->velocity[2] -= pm->ps->gravity * 800 * pml.frametime; //Gravity
PM_WalkMove();
}
else
{
QPM_AirAccelerate( wishdir, wishspeed, pm_accelerate );
pm->ps->velocity[2] -= pm->ps->gravity * 800 * pml.frametime; //Gravity
//PM_FlyMove(); add Quake version later
}
}