From 87d3af7204c38bd821896effe42b9467fd38edc2 Mon Sep 17 00:00:00 2001 From: pogokeen Date: Tue, 25 Jun 2019 18:34:49 +0000 Subject: [PATCH] game.cpp: change camera sprite yvel limits to clamp to min/max angle when beyond the min/max rather than when beyond 0 and 199 git-svn-id: https://svn.eduke32.com/eduke32@7728 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 2 +- source/duke3d/src/game.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index cc84593fd..66308d69d 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -7562,7 +7562,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 { if (pSprite->extra < 1 && (ud.recstat == 0 || !ud.democams)) break; - if (pSprite->extra == 1) + if (klabs(pSprite->extra) == 2) { actor[spriteNum].tempang = pSprite->ang; if (ud.camerasprite != spriteNum) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 7942aefcb..d47c160ef 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -750,9 +750,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) { spritetype *const pSprite = &sprite[ud.camerasprite]; - // XXX: what? - if (pSprite->yvel < 0) pSprite->yvel = -100; - else if (pSprite->yvel > 199) pSprite->yvel = 300; + pSprite->yvel = clamp(TrackerCast(pSprite->yvel), -100, 300); CAMERA(q16ang) = fix16_from_int(actor[ud.camerasprite].tempang + mulscale16(((pSprite->ang + 1024 - actor[ud.camerasprite].tempang) & 2047) - 1024, smoothRatio));