diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 9ee0a6946..f9a28629b 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -4895,15 +4895,15 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5 Bmemcpy(&actor[i].bposx, s, sizeof(vec3_t)); switchpicnum = s->picnum; - if ((s->picnum > NUKEBUTTON)&&(s->picnum <= NUKEBUTTON+3)) + if (s->picnum > NUKEBUTTON && s->picnum <= NUKEBUTTON+3) { switchpicnum = NUKEBUTTON; } - if ((s->picnum > GLASSPIECES)&&(s->picnum <= GLASSPIECES+2)) + if (s->picnum > GLASSPIECES && s->picnum <= GLASSPIECES+2) { switchpicnum = GLASSPIECES; } - if (s->picnum ==INNERJAW+1) + if (s->picnum == INNERJAW+1) { switchpicnum--; } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 27e2e9345..7ed683e03 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -5612,7 +5612,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) break; - case 3: + case SE_3_RANDOM_LIGHTS_AFTER_SHOT_OUT: T4=sector[sect].floorshade; @@ -5678,7 +5678,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) } break; - case 4: //Flashing lights + case SE_4_RANDOM_LIGHTS: //Flashing lights T3 = sector[sect].floorshade; @@ -6008,7 +6008,7 @@ SPAWN_END: return i; } -static int32_t maybe_take_on_pal_of_floor(spritetype *datspr, int32_t sect) +static int32_t G_MaybeTakeOnFloorPal(spritetype *datspr, int32_t sect) { int32_t dapal = sector[sect].floorpal; @@ -6050,7 +6050,7 @@ static int32_t getofs_viewtype7(const spritetype *s, spritetype *t, int32_t a) return k; } -static int32_t adult_tile_p(int32_t pic) +static int32_t G_CheckAdultTile(int32_t pic) { switch (pic) { @@ -6279,7 +6279,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo i = t->owner; s = (i < 0 ? &tsprite[j] : &sprite[i]); - if (ud.lockout && adult_tile_p(DYNAMICTILEMAP(s->picnum))) + if (ud.lockout && G_CheckAdultTile(DYNAMICTILEMAP(s->picnum))) { t->xrepeat = t->yrepeat = 0; continue; @@ -6619,7 +6619,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo t->pal = g_player[p].ps->palookup; } PALONLY: - maybe_take_on_pal_of_floor(t, sect); + G_MaybeTakeOnFloorPal(t, sect); if (s->owner == -1) continue; @@ -6659,7 +6659,7 @@ PALONLY: else t->picnum += T1; t->shade -= 6; - maybe_take_on_pal_of_floor(t, sect); + G_MaybeTakeOnFloorPal(t, sect); break; case WATERBUBBLE__STATIC: @@ -6669,7 +6669,7 @@ PALONLY: break; } default: - maybe_take_on_pal_of_floor(t, sect); + G_MaybeTakeOnFloorPal(t, sect); break; } @@ -6924,7 +6924,7 @@ skip: t->picnum = actor[i].t_data[1]; else t->picnum = actor[s->owner].dispicnum; - if (!maybe_take_on_pal_of_floor(t, sect)) + if (!G_MaybeTakeOnFloorPal(t, sect)) t->pal = sprite[s->owner].pal; t->shade = sprite[s->owner].shade; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index e8492f73b..3597361ec 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3570,7 +3570,7 @@ nullquote: insptr++; index=Gv_GetVarX(*insptr++); - if ((index < aGameArrays[lVarID].size)&&(index>=0)) + if (index>=0 && index < aGameArrays[lVarID].size) { OSD_Printf(OSDTEXT_GREEN "%s: L=%d %s[%d] =%d\n", keyw[g_tw], g_errorLineNum, aGameArrays[lVarID].szLabel, index, diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index c374aa474..0f9ebb7d2 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -3514,7 +3514,7 @@ void P_CheckTouchDamage(DukePlayer_t *p, int32_t obj) else if (wall[obj].cstat&85) { int32_t switchpicnum = wall[obj].overpicnum; - if ((switchpicnum>W_FORCEFIELD)&&(switchpicnum<=W_FORCEFIELD+2)) + if (switchpicnum>W_FORCEFIELD && switchpicnum<=W_FORCEFIELD+2) switchpicnum=W_FORCEFIELD; switch (DYNAMICTILEMAP(switchpicnum)) diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 1235c14db..017feea79 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1094,7 +1094,7 @@ static inline void prelevel(char g) int32_t i, nexti, j, startwall, endwall; int32_t switchpicnum; - uint8_t tagbitmap[65536>>3]; + uint8_t tagbitmap[65536>>3]; // XXX: allocating 8k on the stack isn't that great Bmemset(tagbitmap, 0, sizeof(tagbitmap)); Bmemset(show2dsector, 0, sizeof(show2dsector)); @@ -1295,8 +1295,9 @@ static inline void prelevel(char g) animwall[g_numAnimWalls].tag = 0; animwall[g_numAnimWalls].wallnum = 0; + switchpicnum = wal->overpicnum; - if ((wal->overpicnum > W_FORCEFIELD)&&(wal->overpicnum <= W_FORCEFIELD+2)) + if (wal->overpicnum > W_FORCEFIELD && wal->overpicnum <= W_FORCEFIELD+2) { switchpicnum = W_FORCEFIELD; } @@ -1326,7 +1327,6 @@ static inline void prelevel(char g) wal->lotag; case BIGFORCE__STATIC: - animwall[g_numAnimWalls].wallnum = i; g_numAnimWalls++; @@ -1368,7 +1368,6 @@ static inline void prelevel(char g) case FEMPIC1__STATIC: case FEMPIC2__STATIC: case FEMPIC3__STATIC: - wal->extra = wal->picnum; animwall[g_numAnimWalls].tag = -1; if (ud.lockout) @@ -1388,7 +1387,7 @@ static inline void prelevel(char g) case SCREENBREAK3__STATIC: case SCREENBREAK4__STATIC: case SCREENBREAK5__STATIC: - + // case SCREENBREAK9__STATIC: case SCREENBREAK10__STATIC: case SCREENBREAK11__STATIC: @@ -1400,7 +1399,6 @@ static inline void prelevel(char g) case SCREENBREAK17__STATIC: case SCREENBREAK18__STATIC: case SCREENBREAK19__STATIC: - animwall[g_numAnimWalls].wallnum = i; animwall[g_numAnimWalls].tag = wal->picnum; g_numAnimWalls++; @@ -1994,7 +1992,7 @@ int32_t G_EnterLevel(int32_t g) prelevel(g); - allignwarpelevators(); + G_AlignWarpElevators(); resetpspritevars(g); // automapping = 0; diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 03ff002e7..ab1d82bd3 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -464,9 +464,8 @@ void G_AnimateWalls(void) } if (wall[i].cstat&16) - if ((wall[i].overpicnum >= W_FORCEFIELD)&&(wall[i].overpicnum <= W_FORCEFIELD+2)) + if (wall[i].overpicnum >= W_FORCEFIELD && wall[i].overpicnum <= W_FORCEFIELD+2) { - t = animwall[p].tag; if (wall[i].cstat&254) @@ -1211,7 +1210,7 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite) { switchpicnum--; } - if ((picnum > MULTISWITCH)&&(picnum <= MULTISWITCH+3)) + if (picnum > MULTISWITCH && picnum <= MULTISWITCH+3) { switchpicnum = MULTISWITCH; } @@ -1489,7 +1488,7 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite) { switchpicnum--; } - if ((picnum > MULTISWITCH)&&(picnum <= MULTISWITCH+3)) + if (picnum > MULTISWITCH && picnum <= MULTISWITCH+3) { switchpicnum = MULTISWITCH; } @@ -1689,7 +1688,7 @@ void A_DamageWall(int32_t spr,int32_t dawallnum,const vec3_t *pos,int32_t atwith if (sector[wal->nextsector].floorz-sector[wal->nextsector].ceilingz) { int32_t switchpicnum = wal->overpicnum; - if ((switchpicnum > W_FORCEFIELD)&&(switchpicnum <= W_FORCEFIELD+2)) + if (switchpicnum > W_FORCEFIELD && switchpicnum <= W_FORCEFIELD+2) switchpicnum = W_FORCEFIELD; switch (DYNAMICTILEMAP(switchpicnum)) { @@ -1993,7 +1992,7 @@ void A_DamageObject(int32_t i,int32_t sn) rpg = 1; /* switchpicnum = PN; - if ((PN > WATERFOUNTAIN)&&(PN < WATERFOUNTAIN+3)) + if (PN > WATERFOUNTAIN && PN < WATERFOUNTAIN+3) { switchpicnum = WATERFOUNTAIN; } @@ -2439,7 +2438,7 @@ void A_DamageObject(int32_t i,int32_t sn) } } -void allignwarpelevators(void) +void G_AlignWarpElevators(void) { int32_t j, i = headspritestat[STAT_EFFECTOR]; diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index 205f7ae84..20d953529 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -103,7 +103,7 @@ int32_t A_CheckHitSprite(int32_t i,int16_t *hitsp); void A_DamageObject(int32_t i,int32_t sn); void A_DamageWall(int32_t spr,int32_t dawallnum,const vec3_t *pos,int32_t atwith); int32_t __fastcall A_FindPlayer(const spritetype *s,int32_t *d); -void allignwarpelevators(void); +void G_AlignWarpElevators(void); int32_t CheckDoorTile(int32_t dapic); void G_AnimateCamSprite(void); void G_AnimateWalls(void);