- Blood: Avoid integer truncation when updating player's sprite angle with actual angle of player.

* Fixes #256.
This commit is contained in:
Mitchell Richters 2021-01-10 18:17:29 +11:00
parent 98ee5178aa
commit 41ad44bf40
2 changed files with 3 additions and 11 deletions

View file

@ -683,7 +683,7 @@ void playerStart(int nPlayer, int bNewLevel)
pSprite->z -= bottom - pSprite->z; pSprite->z -= bottom - pSprite->z;
pSprite->pal = 11+(pPlayer->teamId&3); pSprite->pal = 11+(pPlayer->teamId&3);
pSprite->ang = pStartZone->ang; pSprite->ang = pStartZone->ang;
pPlayer->angold = pPlayer->angle.ang = buildang(pSprite->ang); pPlayer->angle.ang = buildang(pSprite->ang);
pSprite->type = kDudePlayer1+nPlayer; pSprite->type = kDudePlayer1+nPlayer;
pSprite->clipdist = pDudeInfo->clipdist; pSprite->clipdist = pDudeInfo->clipdist;
pSprite->flags = 15; pSprite->flags = 15;
@ -1285,11 +1285,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3)
void UpdatePlayerSpriteAngle(PLAYER *pPlayer) void UpdatePlayerSpriteAngle(PLAYER *pPlayer)
{ {
spritetype *pSprite = pPlayer->pSprite; pPlayer->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();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -1339,9 +1335,7 @@ void ProcessInput(PLAYER *pPlayer)
char bSeqStat = playerSeqPlaying(pPlayer, 16); char bSeqStat = playerSeqPlaying(pPlayer, 16);
if (pPlayer->fraggerId != -1) if (pPlayer->fraggerId != -1)
{ {
pPlayer->angold = bvectangbam(sprite[pPlayer->fraggerId].x - pSprite->x, sprite[pPlayer->fraggerId].y - pSprite->y); pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, 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; pPlayer->deathTime += 4;
if (!bSeqStat) if (!bSeqStat)
@ -2271,7 +2265,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
("pickupeffect", w.pickupEffect) ("pickupeffect", w.pickupEffect)
("flasheffect", w.flashEffect) ("flasheffect", w.flashEffect)
("quakeeffect", w.quakeEffect) ("quakeeffect", w.quakeEffect)
("angold", w.angold)
("player_par", w.player_par) ("player_par", w.player_par)
("waterpal", w.nWaterPal) ("waterpal", w.nWaterPal)
.Array("posturedata", &w.pPosture[0][0], &gPostureDefaults[0][0], kModeMax * kPostureMax) // only save actual changes in this. .Array("posturedata", &w.pPosture[0][0], &gPostureDefaults[0][0], kModeMax * kPostureMax) // only save actual changes in this.

View file

@ -174,7 +174,6 @@ struct PLAYER
int pickupEffect; int pickupEffect;
bool flashEffect; // if true, reduce pPlayer->visibility counter bool flashEffect; // if true, reduce pPlayer->visibility counter
int quakeEffect; int quakeEffect;
binangle angold;
int player_par; int player_par;
int nWaterPal; int nWaterPal;
POSTURE pPosture[kModeMax][kPostureMax]; POSTURE pPosture[kModeMax][kPostureMax];