From cf7de5b43a939d137bfc08b1c913beed1a127a91 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 18 Apr 2015 21:59:17 +0000 Subject: [PATCH] actors.c: fix 3 incorrect '/' -> tabledivide32_noinline rewrites in r4658. Division has higher precedence than bitwise-OR. The cases concerned SE3, SE4 and NEON* sprites. Incidental info: the blinking of NEON* sprites can be controlled via their lotag, similarly to how you how you give a "random flash number" as SE4 hitag. git-svn-id: https://svn.eduke32.com/eduke32@5155 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 1110558f7..ae2dbdd7a 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -4966,7 +4966,8 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5 case NEON5__STATIC: case NEON6__STATIC: - if (tabledivide32_noinline(g_globalRandom, (s->lotag+1)&31) > 4) s->shade = -127; + if ((tabledivide32_noinline(g_globalRandom, s->lotag+1)&31) > 4) + s->shade = -127; else s->shade = 127; goto BOLT; @@ -6235,7 +6236,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 // if(t[5] > 0) { t[5]--; break; } - if (tabledivide32_noinline(g_globalRandom, (sh+1)&31) < 4 && !t[2]) + if ((tabledivide32_noinline(g_globalRandom, sh+1)&31) < 4 && !t[2]) { // t[5] = 4+(g_globalRandom&7); sc->ceilingpal = s->owner>>8; @@ -6271,8 +6272,13 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 } case SE_4_RANDOM_LIGHTS: + { + // See A_Spawn(): + // s->owner: original ((ceilingpal<<8) | floorpal) + // t[2]: original floor shade + // t[3]: max wall shade - if (tabledivide32_noinline(g_globalRandom, (sh+1)&31) < 4) + if ((tabledivide32_noinline(g_globalRandom, sh+1)&31) < 4) { t[1] = s->shade + (g_globalRandom&15);//Got really bright t[0] = s->shade + (g_globalRandom&15); @@ -6323,6 +6329,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 KILLIT(i); break; + } //BOSS case SE_5: