From f429871cc6a5e3130d966dabe282ab9468e41b2d Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 30 Nov 2020 19:57:21 +1100 Subject: [PATCH] - Blood: Promote `pPlayer->angold` to binangle class. --- source/blood/src/player.cpp | 15 ++++++++------- source/blood/src/player.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 90cd70cdd..ffdf72df0 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -707,8 +707,8 @@ void playerStart(int nPlayer, int bNewLevel) GetSpriteExtents(pSprite, &top, &bottom); pSprite->z -= bottom - pSprite->z; pSprite->pal = 11+(pPlayer->teamId&3); - pPlayer->angold = pSprite->ang = pStartZone->ang; - pPlayer->angle.ang = buildang(pSprite->ang); + pSprite->ang = pStartZone->ang; + pPlayer->angold = pPlayer->angle.ang = buildang(pSprite->ang); pSprite->type = kDudePlayer1+nPlayer; pSprite->clipdist = pDudeInfo->clipdist; pSprite->flags = 15; @@ -1312,8 +1312,9 @@ void UpdatePlayerSpriteAngle(PLAYER *pPlayer) { spritetype *pSprite = pPlayer->pSprite; - pPlayer->angle.ang += buildang(pSprite->ang - pPlayer->angold); - pPlayer->angold = pSprite->ang = pPlayer->angle.ang.asbuild(); + pPlayer->angle.ang += buildang(pSprite->ang) - pPlayer->angold; + pPlayer->angold = pPlayer->angle.ang; + pSprite->ang = pPlayer->angle.ang.asbuild(); } void ProcessInput(PLAYER *pPlayer) @@ -1346,9 +1347,9 @@ void ProcessInput(PLAYER *pPlayer) char bSeqStat = playerSeqPlaying(pPlayer, 16); if (pPlayer->fraggerId != -1) { - auto fraggerAng = bvectangbam(sprite[pPlayer->fraggerId].x - pSprite->x, sprite[pPlayer->fraggerId].y - pSprite->y); - pPlayer->angold = pSprite->ang = fraggerAng.asbuild(); - pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, fraggerAng)); + pPlayer->angold = bvectangbam(sprite[pPlayer->fraggerId].x - pSprite->x, sprite[pPlayer->fraggerId].y - pSprite->y); + pSprite->ang = pPlayer->angold.asbuild(); + pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, pPlayer->angold)); } pPlayer->deathTime += 4; if (!bSeqStat) diff --git a/source/blood/src/player.h b/source/blood/src/player.h index 27d3e7bef..6664282a6 100644 --- a/source/blood/src/player.h +++ b/source/blood/src/player.h @@ -175,7 +175,7 @@ struct PLAYER int pickupEffect; bool flashEffect; // if true, reduce pPlayer->visibility counter int quakeEffect; - int angold; + binangle angold; int player_par; int nWaterPal; POSTURE pPosture[kModeMax][kPostureMax];