From f55758bc2e46351c2584cea0d6401feb6d77d5a7 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 27 Jun 2017 11:01:26 +0000 Subject: [PATCH] When calculating which rotation to use for CON action viewtype 7, offset the frame intervals by 15 degrees instead of 22.5, clearly a copypaste error from viewtypes 5 or 8. Now these are properly centered. git-svn-id: https://svn.eduke32.com/eduke32@6304 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 6d936c660..8093abd40 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -3437,12 +3437,13 @@ static int32_t getofs_viewtype5(const uspritetype *pSprite, uspritetype *pTSprit static int32_t getofs_viewtype7(const uspritetype *pSprite, uspritetype *pTSprite, int viewAng, uint8_t invertp) { int angDiff = invertp ? viewAng - pSprite->ang : pSprite->ang - viewAng; - int frameOffset = ((angDiff + 3072 + 128) & 2047) / 170; + int frameOffset = ((angDiff + 3072 + 85) & 2047) / 170; if (frameOffset > 6) { + if (frameOffset < 12) + pTSprite->cstat |= 4; frameOffset = 12 - frameOffset; - pTSprite->cstat |= 4; } else pTSprite->cstat &= ~4;