diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 8d179e0a5..94f39fbb1 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -1362,10 +1362,10 @@ ACTOR_STATIC void G_MoveFallers(void) } else if (T1 == 1) { - if (s->lotag < INT16_MAX) + if ((int16_t)s->lotag > 0) { s->lotag-=3; - if (s->lotag > INT16_MAX) + if ((int16_t)s->lotag <= 0) { s->xvel = (32+(krand()&63)); s->zvel = -(1024+(krand()&1023)); @@ -1905,7 +1905,7 @@ ACTOR_STATIC void G_MoveStandables(void) A_PlaySound(PIPEBOMB_EXPLODE,j); A_PlaySound(GLASS_HEAVYBREAK,j); - if (s->hitag < INT16_MAX) + if ((int16_t)s->hitag > 0) { j = headspritestat[STAT_STANDABLE]; while (j >= 0) @@ -1959,10 +1959,11 @@ ACTOR_STATIC void G_MoveStandables(void) { if (s->shade == -32) { - if (s->lotag < INT16_MAX) + if ((int16_t)s->lotag > 0) { s->lotag-=3; - if (s->lotag > INT16_MAX) s->lotag = UINT16_MAX-99; + if ((int16_t)s->lotag <= 0) + s->lotag = (uint16_t)(-99); } else s->shade = -33; @@ -2023,7 +2024,7 @@ DETONATE: if (s->xrepeat) for (x=0; x<8; x++) RANDOMSCRAP; - if ((t[3] == 1 && s->xrepeat) || s->lotag == UINT16_MAX-99) + if ((t[3] == 1 && s->xrepeat) || (int16_t)s->lotag == -99) { int32_t j = A_Spawn(i,EXPLOSION2); x = s->extra; @@ -2042,7 +2043,7 @@ DETONATE: if (s->yvel == 1) { s->hitag--; - if (s->hitag == UINT16_MAX) + if ((int16_t)s->hitag <= 0) { G_OperateSectors(sect,i); @@ -2264,7 +2265,7 @@ CLEAR_THE_BOLT: goto BOLT; case TOUCHPLATE__STATIC: - if (t[1] == 1 && s->hitag != UINT16_MAX) //Move the sector floor + if (t[1] == 1 && (int16_t)s->hitag >= 0) //Move the sector floor { x = sector[sect].floorz; @@ -2317,7 +2318,7 @@ CLEAR_THE_BOLT: t[3] = !t[3]; G_OperateMasterSwitches(s->lotag); G_OperateActivators(s->lotag,p); - if (s->hitag < INT16_MAX) + if ((int16_t)s->hitag > 0) { s->hitag--; if (s->hitag == 0) t[5] = 1;