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;