Hexen2: Fix ring of flight.

This commit is contained in:
Shpoike 2023-06-05 23:45:32 +01:00
parent 04f2e112e7
commit 732e3a0847

View file

@ -9515,7 +9515,7 @@ static void SV_AirMove (void)
} }
} }
static void SV_WaterMove (void) static void SV_WaterMove (qboolean flymode)
{ {
int i; int i;
vec3_t wishvel; vec3_t wishvel;
@ -9531,7 +9531,9 @@ static void SV_WaterMove (void)
for (i=0 ; i<3 ; i++) for (i=0 ; i<3 ; i++)
wishvel[i] = forward[i]*cmd.forwardmove + right[i]*cmd.sidemove; wishvel[i] = forward[i]*cmd.forwardmove + right[i]*cmd.sidemove;
if (!cmd.forwardmove && !cmd.sidemove && !cmd.upmove) if (flymode)
VectorMA(wishvel, cmd.upmove, up, wishvel);
else if (!cmd.forwardmove && !cmd.sidemove && !cmd.upmove)
wishvel[2] -= 60; // drift towards bottom wishvel[2] -= 60; // drift towards bottom
else else
wishvel[2] += cmd.upmove; wishvel[2] += cmd.upmove;
@ -9553,6 +9555,7 @@ static void SV_WaterMove (void)
VectorScale (wishvel, maxspeed/wishspeed, wishvel); VectorScale (wishvel, maxspeed/wishspeed, wishvel);
wishspeed = maxspeed*scale; wishspeed = maxspeed*scale;
} }
if (!flymode)
wishspeed *= 0.7; wishspeed *= 0.7;
// //
@ -9767,7 +9770,11 @@ void SV_ClientThink (void)
// walk // walk
// //
if ( (sv_player->v->waterlevel >= 2) && (sv_player->v->movetype != MOVETYPE_NOCLIP) ) if ( (sv_player->v->waterlevel >= 2) && (sv_player->v->movetype != MOVETYPE_NOCLIP) )
SV_WaterMove (); SV_WaterMove (false);
#ifdef HEXEN2
else if (progstype == PROG_H2 && sv_player->v->movetype == MOVETYPE_FLY)
SV_WaterMove (true); //just reuse our swimming code for hexen2's flying (quake tends to deny traction).
#endif
else if (((int)sv_player->xv->pmove_flags&PMF_LADDER) && (sv_player->v->movetype != MOVETYPE_NOCLIP) ) else if (((int)sv_player->xv->pmove_flags&PMF_LADDER) && (sv_player->v->movetype != MOVETYPE_NOCLIP) )
SV_LadderMove(); SV_LadderMove();
else else