From 0dd837919e2ca2de90f920fe2ec4e3bd29f842c8 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 23 Jun 2017 04:32:23 +0000 Subject: [PATCH] Revise r6239 git-svn-id: https://svn.eduke32.com/eduke32@6242 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 10 +++++----- source/duke3d/src/sector.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index b9c420ead..d5a5ad060 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -309,12 +309,12 @@ next_sprite: // : below->above change? static int32_t Proj_MaybeDoTransport(int32_t spriteNum, const uspritetype * const pSEffector, int32_t fromunderp, int32_t daz) { - if ((totalclock & (UINT8_MAX-1)) <= actor[spriteNum].lasttransport) + if ((totalclock & UINT8_MAX) == actor[spriteNum].lasttransport) return 0; spritetype *const pSprite = &sprite[spriteNum]; const uspritetype *const otherse = (uspritetype *)&sprite[pSEffector->owner]; - actor[spriteNum].lasttransport = (totalclock + (TICSPERFRAME << 2)) & (UINT8_MAX-1); + actor[spriteNum].lasttransport = (totalclock & UINT8_MAX); pSprite->x += (otherse->x - pSEffector->x); pSprite->y += (otherse->y - pSEffector->y); @@ -3483,7 +3483,7 @@ ACTOR_STATIC void G_MoveTransports(void) case STAT_FALLER: case STAT_DUMMYPLAYER: { - if ((totalclock & (UINT8_MAX-1)) > actor[sectSprite].lasttransport) + if ((totalclock & UINT8_MAX) != actor[sectSprite].lasttransport) { int const zvel = sprite[sectSprite].zvel; int const absZvel = klabs(zvel); @@ -3558,7 +3558,7 @@ ACTOR_STATIC void G_MoveTransports(void) A_SetSprite(newSprite, CLIPMASK0); } - actor[sectSprite].lasttransport = (totalclock + (TICSPERFRAME << 2)) & (UINT8_MAX-1); + actor[sectSprite].lasttransport = (totalclock & UINT8_MAX); sprite[sectSprite].x += sprite[OW(spriteNum)].x - SX(spriteNum); sprite[sectSprite].y += sprite[OW(spriteNum)].y - SY(spriteNum); @@ -5664,7 +5664,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 j = pSprite->owner; - if (sprite[j].lotag == UINT8_MAX) + if (sprite[j].lotag == UINT16_MAX) DELETE_SPRITE_AND_CONTINUE(spriteNum); q = pSector->extra>>3; diff --git a/source/duke3d/src/sector.cpp b/source/duke3d/src/sector.cpp index c718a8be3..1e9ff45fe 100644 --- a/source/duke3d/src/sector.cpp +++ b/source/duke3d/src/sector.cpp @@ -1191,10 +1191,10 @@ int P_ActivateSwitch(int playerNum, int wallOrSprite, int switchType) if (switchType == SWITCH_SPRITE) // A wall sprite { - if (actor[wallOrSprite].lasttransport == (totalclock & (UINT8_MAX-1))) + if (actor[wallOrSprite].lasttransport == (totalclock & UINT8_MAX)) return 0; - actor[wallOrSprite].lasttransport = (totalclock & (UINT8_MAX-1)); + actor[wallOrSprite].lasttransport = (totalclock & UINT8_MAX); if (sprite[wallOrSprite].lotag == 0) return 0;