mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Emulate previous behavior for player oang/ohoriz/angvel struct members
git-svn-id: https://svn.eduke32.com/eduke32@8605 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b48de3ca3c
commit
ce2c378dcb
2 changed files with 22 additions and 4 deletions
|
@ -1279,6 +1279,23 @@ static int P_Submerge(int, DukePlayer_t *, int, int);
|
||||||
static int P_Emerge(int, DukePlayer_t *, int, int);
|
static int P_Emerge(int, DukePlayer_t *, int, int);
|
||||||
static void P_FinishWaterChange(int, DukePlayer_t *, int, int, int);
|
static void P_FinishWaterChange(int, DukePlayer_t *, int, int, int);
|
||||||
|
|
||||||
|
static fix16_t P_GetQ16AngleDeltaForTic(DukePlayer_t const *pPlayer)
|
||||||
|
{
|
||||||
|
auto oldAngle = pPlayer->oq16ang;
|
||||||
|
auto newAngle = pPlayer->q16ang;
|
||||||
|
|
||||||
|
if (klabs(fix16_sub(oldAngle, newAngle)) < F16(1024))
|
||||||
|
return fix16_sub(newAngle, oldAngle);
|
||||||
|
|
||||||
|
if (newAngle > F16(1024))
|
||||||
|
newAngle = fix16_sub(newAngle, F16(2048));
|
||||||
|
|
||||||
|
if (oldAngle > F16(1024))
|
||||||
|
oldAngle = fix16_sub(oldAngle, F16(2048));
|
||||||
|
|
||||||
|
return fix16_sub(newAngle, oldAngle);
|
||||||
|
}
|
||||||
|
|
||||||
ACTOR_STATIC void G_MovePlayers(void)
|
ACTOR_STATIC void G_MovePlayers(void)
|
||||||
{
|
{
|
||||||
int spriteNum = headspritestat[STAT_PLAYER];
|
int spriteNum = headspritestat[STAT_PLAYER];
|
||||||
|
@ -1332,6 +1349,11 @@ ACTOR_STATIC void G_MovePlayers(void)
|
||||||
if (G_HaveActor(sprite[spriteNum].picnum))
|
if (G_HaveActor(sprite[spriteNum].picnum))
|
||||||
A_Execute(spriteNum, P_GetP(pSprite), otherPlayerDist);
|
A_Execute(spriteNum, P_GetP(pSprite), otherPlayerDist);
|
||||||
|
|
||||||
|
pPlayer->q16angvel = P_GetQ16AngleDeltaForTic(pPlayer);
|
||||||
|
pPlayer->oq16ang = pPlayer->q16ang;
|
||||||
|
pPlayer->oq16horiz = pPlayer->q16horiz;
|
||||||
|
pPlayer->oq16horizoff = pPlayer->q16horizoff;
|
||||||
|
|
||||||
if (g_netServer || ud.multimode > 1)
|
if (g_netServer || ud.multimode > 1)
|
||||||
{
|
{
|
||||||
if (sprite[g_player[otherp].ps->i].extra > 0)
|
if (sprite[g_player[otherp].ps->i].extra > 0)
|
||||||
|
|
|
@ -4806,9 +4806,6 @@ void P_ProcessInput(int playerNum)
|
||||||
actor[pPlayer->i].floorz = floorZ;
|
actor[pPlayer->i].floorz = floorZ;
|
||||||
actor[pPlayer->i].ceilingz = ceilZ;
|
actor[pPlayer->i].ceilingz = ceilZ;
|
||||||
|
|
||||||
pPlayer->oq16horiz = pPlayer->q16horiz;
|
|
||||||
pPlayer->oq16horizoff = pPlayer->q16horizoff;
|
|
||||||
|
|
||||||
if ((highZhit & 49152) == 49152)
|
if ((highZhit & 49152) == 49152)
|
||||||
{
|
{
|
||||||
int const spriteNum = highZhit & (MAXSPRITES-1);
|
int const spriteNum = highZhit & (MAXSPRITES-1);
|
||||||
|
@ -4983,7 +4980,6 @@ void P_ProcessInput(int playerNum)
|
||||||
pPlayer->bobpos = pPlayer->pos.vec2;
|
pPlayer->bobpos = pPlayer->pos.vec2;
|
||||||
pPlayer->opos.z = pPlayer->pos.z;
|
pPlayer->opos.z = pPlayer->pos.z;
|
||||||
pPlayer->opyoff = pPlayer->pyoff;
|
pPlayer->opyoff = pPlayer->pyoff;
|
||||||
pPlayer->oq16ang = pPlayer->q16ang;
|
|
||||||
|
|
||||||
updatesector(pPlayer->pos.x, pPlayer->pos.y, &pPlayer->cursectnum);
|
updatesector(pPlayer->pos.x, pPlayer->pos.y, &pPlayer->cursectnum);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue