mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-03-12 12:02:32 +00:00
Possibly fixed the jumping bug.
This commit is contained in:
parent
28c18f0e15
commit
7062960a7c
1 changed files with 20 additions and 6 deletions
|
@ -59,6 +59,7 @@ vec3_t player_maxs = {16, 16, 32};
|
|||
// #define PM_WATERFRICTION 1
|
||||
|
||||
void PM_InitBoxHull (void);
|
||||
void PM_CategorizePosition (void);
|
||||
|
||||
void Pmove_Init (void)
|
||||
{
|
||||
|
@ -520,6 +521,7 @@ void PM_AirMove (void)
|
|||
float fmove, smove;
|
||||
vec3_t wishdir;
|
||||
float wishspeed;
|
||||
vec3_t original;
|
||||
|
||||
fmove = pmove.cmd.forwardmove;
|
||||
smove = pmove.cmd.sidemove;
|
||||
|
@ -562,8 +564,20 @@ void PM_AirMove (void)
|
|||
// add gravity
|
||||
pmove.velocity[2] -= movevars.entgravity * movevars.gravity * frametime;
|
||||
|
||||
if ( ! PM_FlyMove() )
|
||||
{
|
||||
// the move didn't block
|
||||
PM_CategorizePosition ();
|
||||
if (onground != -1) // but we're on ground now
|
||||
{
|
||||
// Con_Printf ("Jumping bug!\n");
|
||||
VectorCopy (pmove.origin, original);
|
||||
// Calculate correct velocity
|
||||
PM_FlyMove();
|
||||
|
||||
// Restore position
|
||||
VectorCopy (original, pmove.origin);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//Con_Printf("airmove:vec: %4.2f %4.2f %4.2f\n",
|
||||
|
@ -580,10 +594,10 @@ void PM_AirMove (void)
|
|||
|
||||
/*
|
||||
=============
|
||||
PM_CatagorizePosition
|
||||
PM_CategorizePosition
|
||||
=============
|
||||
*/
|
||||
void PM_CatagorizePosition (void)
|
||||
void PM_CategorizePosition (void)
|
||||
{
|
||||
vec3_t point;
|
||||
int cont;
|
||||
|
@ -887,7 +901,7 @@ void PlayerMove (void)
|
|||
VectorCopy (pmove.cmd.angles, pmove.angles);
|
||||
|
||||
// set onground, watertype, and waterlevel
|
||||
PM_CatagorizePosition ();
|
||||
PM_CategorizePosition ();
|
||||
|
||||
if (waterlevel == 2)
|
||||
CheckWaterJump ();
|
||||
|
@ -908,6 +922,6 @@ void PlayerMove (void)
|
|||
PM_AirMove ();
|
||||
|
||||
// set onground, watertype, and waterlevel for final spot
|
||||
PM_CatagorizePosition ();
|
||||
PM_CategorizePosition ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue