From 38e3d16aeb7cfc59d8c773a76b77dbb815c61883 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 14 Nov 2006 21:35:50 +0000 Subject: [PATCH] More formatting changes git-svn-id: https://svn.eduke32.com/eduke32@333 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 1002 ++++++++++++------------ polymer/eduke32/source/anim.c | 8 +- polymer/eduke32/source/astub.c | 28 +- polymer/eduke32/source/config.c | 400 +++++----- polymer/eduke32/source/game.c | 860 ++++++++++---------- polymer/eduke32/source/gamedef.c | 334 ++++---- polymer/eduke32/source/gameexec.c | 440 +++++------ polymer/eduke32/source/menus.c | 386 ++++----- polymer/eduke32/source/osdcmds.c | 4 +- polymer/eduke32/source/player.c | 680 ++++++++-------- polymer/eduke32/source/premap.c | 108 +-- polymer/eduke32/source/rts.c | 38 +- polymer/eduke32/source/savegame.c | 24 +- polymer/eduke32/source/sector.c | 428 +++++----- polymer/eduke32/source/sounds.c | 158 ++-- polymer/eduke32/source/startgtk.game.c | 432 +++++----- polymer/eduke32/source/startwin.game.c | 4 +- polymer/eduke32/source/testcd.c | 4 +- polymer/eduke32/source/winbits.c | 2 +- 19 files changed, 2670 insertions(+), 2670 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 2685b0aa2..6d6c03363 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -80,7 +80,7 @@ void restoreinterpolations() //Stick at end of drawscreen long ceilingspace(short sectnum) { - if ( (sector[sectnum].ceilingstat&1) && sector[sectnum].ceilingpal == 0 ) + if ((sector[sectnum].ceilingstat&1) && sector[sectnum].ceilingpal == 0) { if ((sector[sectnum].ceilingpicnum==MOONSKY1)||(sector[sectnum].ceilingpicnum==BIGORBIT1)) return 1; @@ -90,24 +90,24 @@ long ceilingspace(short sectnum) long floorspace(short sectnum) { - if ( (sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0 ) + if ((sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0) { if ((sector[sectnum].floorpicnum==MOONSKY1)||(sector[sectnum].floorpicnum==BIGORBIT1)) return 1; } return 0; } -void addammo( short weapon,struct player_struct *p,short amount) +void addammo(short weapon,struct player_struct *p,short amount) { p->ammo_amount[weapon] += amount; - if ( p->ammo_amount[weapon] > max_ammo_amount[weapon] ) + if (p->ammo_amount[weapon] > max_ammo_amount[weapon]) p->ammo_amount[weapon] = max_ammo_amount[weapon]; } -void addweaponnoswitch( struct player_struct *p, short weapon) +void addweaponnoswitch(struct player_struct *p, short weapon) { - if ( p->gotweapon[weapon] == 0 ) + if (p->gotweapon[weapon] == 0) { p->gotweapon[weapon] = 1; if (weapon == SHRINKER_WEAPON) @@ -143,7 +143,7 @@ void addweaponnoswitch( struct player_struct *p, short weapon) } } -void addweapon( struct player_struct *p,short weapon) +void addweapon(struct player_struct *p,short weapon) { short snum; snum = sprite[p->i].yvel; @@ -186,7 +186,7 @@ void addweapon( struct player_struct *p,short weapon) } } -void checkavailinven( struct player_struct *p ) +void checkavailinven(struct player_struct *p) { if (p->firstaid_amount > 0) @@ -206,7 +206,7 @@ void checkavailinven( struct player_struct *p ) else p->inven_icon = 0; } -void checkavailweapon( struct player_struct *p ) +void checkavailweapon(struct player_struct *p) { short i,snum; int32 weap; @@ -219,7 +219,7 @@ void checkavailweapon( struct player_struct *p ) p->wantweaponfire = -1; if (weap == p->curr_weapon) return; - else if ( p->gotweapon[weap] && p->ammo_amount[weap] > 0 ) + else if (p->gotweapon[weap] && p->ammo_amount[weap] > 0) { addweapon(p,weap); return; @@ -227,9 +227,9 @@ void checkavailweapon( struct player_struct *p ) } weap = p->curr_weapon; - if ( p->gotweapon[weap] && p->ammo_amount[weap] > 0 ) + if (p->gotweapon[weap] && p->ammo_amount[weap] > 0) return; - if ( p->gotweapon[weap] && !(p->weaponswitch & 2)) + if (p->gotweapon[weap] && !(p->weaponswitch & 2)) return; snum = sprite[p->i].yvel; @@ -242,7 +242,7 @@ void checkavailweapon( struct player_struct *p ) if (weap == 0) weap = 9; else weap--; - if ( weap == 0 || ( p->gotweapon[weap] && p->ammo_amount[weap] > 0 ) ) + if (weap == 0 || (p->gotweapon[weap] && p->ammo_amount[weap] > 0)) break; } @@ -293,7 +293,7 @@ long ifsquished(short i, short p) } else squishme = 0; - if ( squishme ) + if (squishme) { FTA(10,&ps[p]); @@ -311,7 +311,7 @@ long ifsquished(short i, short p) return 0; } -void hitradius( short i, long r, long hp1, long hp2, long hp3, long hp4 ) +void hitradius(short i, long r, long hp1, long hp2, long hp3, long hp4) { spritetype *s,*sj; walltype *wal; @@ -350,7 +350,7 @@ void hitradius( short i, long r, long hp1, long hp2, long hp3, long hp4 ) startwall = sector[dasect].wallptr; endwall = startwall+sector[dasect].wallnum; for (x=startwall,wal=&wall[startwall];xx-s->x)+klabs(wal->y-s->y) ) < r) + if ((klabs(wal->x-s->x)+klabs(wal->y-s->y)) < r) { nextsect = wal->nextsector; if (nextsect >= 0) @@ -362,7 +362,7 @@ void hitradius( short i, long r, long hp1, long hp2, long hp3, long hp4 ) x1 = (((wal->x+wall[wal->point2].x)>>1)+s->x)>>1; y1 = (((wal->y+wall[wal->point2].y)>>1)+s->y)>>1; updatesector(x1,y1,§); - if ( sect >= 0 && cansee(x1,y1,s->z,sect,s->x,s->y,s->z,s->sectnum ) ) + if (sect >= 0 && cansee(x1,y1,s->z,sect,s->x,s->y,s->z,s->sectnum)) checkhitwall(i,x,wal->x,wal->y,s->z,s->picnum); } } @@ -381,85 +381,85 @@ SKIPWALLCHECK: nextj = nextspritestat[j]; sj = &sprite[j]; - if ( x == 0 || x >= 5 || AFLAMABLE(sj->picnum) ) + if (x == 0 || x >= 5 || AFLAMABLE(sj->picnum)) { - if ( s->picnum != SHRINKSPARK || (sj->cstat&257) ) - if ( dist( s, sj ) < r ) + if (s->picnum != SHRINKSPARK || (sj->cstat&257)) + if (dist(s, sj) < r) { - if ( badguy(sj) && !cansee( sj->x, sj->y,sj->z+q, sj->sectnum, s->x, s->y, s->z+q, s->sectnum) ) + if (badguy(sj) && !cansee(sj->x, sj->y,sj->z+q, sj->sectnum, s->x, s->y, s->z+q, s->sectnum)) goto BOLT; - checkhitsprite( j, i ); + checkhitsprite(j, i); } } - else if ( sj->extra >= 0 && sj != s && ( sj->picnum == TRIPBOMB || badguy(sj) || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL || (sj->cstat&257) || sj->picnum == DUKELYINGDEAD ) ) + else if (sj->extra >= 0 && sj != s && (sj->picnum == TRIPBOMB || badguy(sj) || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL || (sj->cstat&257) || sj->picnum == DUKELYINGDEAD)) { - if ( s->picnum == SHRINKSPARK && sj->picnum != SHARK && ( j == s->owner || sj->xrepeat < 24 ) ) + if (s->picnum == SHRINKSPARK && sj->picnum != SHARK && (j == s->owner || sj->xrepeat < 24)) { j = nextj; continue; } - if ( s->picnum == MORTER && j == s->owner) + if (s->picnum == MORTER && j == s->owner) { j = nextj; continue; } if (sj->picnum == APLAYER) sj->z -= PHEIGHT; - d = dist( s, sj ); + d = dist(s, sj); if (sj->picnum == APLAYER) sj->z += PHEIGHT; - if ( d < r && cansee( sj->x, sj->y, sj->z-(8<<8), sj->sectnum, s->x, s->y, s->z-(12<<8), s->sectnum) ) + if (d < r && cansee(sj->x, sj->y, sj->z-(8<<8), sj->sectnum, s->x, s->y, s->z-(12<<8), s->sectnum)) { hittype[j].ang = getangle(sj->x-s->x,sj->y-s->y); - if ( s->picnum == RPG && sj->extra > 0) + if (s->picnum == RPG && sj->extra > 0) hittype[j].picnum = RPG; else if (checkspriteflags(i,SPRITE_FLAG_PROJECTILE) && thisprojectile[i].workslike & PROJECTILE_FLAG_RADIUS_PICNUM && sj->extra > 0) hittype[j].picnum = s->picnum; else { - if ( s->picnum == SHRINKSPARK ) + if (s->picnum == SHRINKSPARK) hittype[j].picnum = SHRINKSPARK; else hittype[j].picnum = RADIUSEXPLOSION; } if (s->picnum != SHRINKSPARK) { - if ( d < r/3 ) + if (d < r/3) { if (hp4 == hp3) hp4++; hittype[j].extra = hp3 + (TRAND%(hp4-hp3)); } - else if ( d < 2*r/3 ) + else if (d < 2*r/3) { if (hp3 == hp2) hp3++; hittype[j].extra = hp2 + (TRAND%(hp3-hp2)); } - else if ( d < r ) + else if (d < r) { if (hp2 == hp1) hp2++; hittype[j].extra = hp1 + (TRAND%(hp2-hp1)); } - if ( sprite[j].picnum != TANK && sprite[j].picnum != ROTATEGUN && sprite[j].picnum != RECON && sprite[j].picnum != BOSS1 && sprite[j].picnum != BOSS2 && sprite[j].picnum != BOSS3 && sprite[j].picnum != BOSS4 ) + if (sprite[j].picnum != TANK && sprite[j].picnum != ROTATEGUN && sprite[j].picnum != RECON && sprite[j].picnum != BOSS1 && sprite[j].picnum != BOSS2 && sprite[j].picnum != BOSS3 && sprite[j].picnum != BOSS4) { if (sj->xvel < 0) sj->xvel = 0; sj->xvel += (s->extra<<2); } - if ( sj->picnum == PODFEM1 || sj->picnum == FEM1 || + if (sj->picnum == PODFEM1 || sj->picnum == FEM1 || sj->picnum == FEM2 || sj->picnum == FEM3 || sj->picnum == FEM4 || sj->picnum == FEM5 || sj->picnum == FEM6 || sj->picnum == FEM7 || sj->picnum == FEM8 || sj->picnum == FEM9 || sj->picnum == FEM10 || sj->picnum == STATUE || sj->picnum == STATUEFLASH || sj->picnum == SPACEMARINE || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL) - checkhitsprite( j, i ); + checkhitsprite(j, i); } else if (s->extra == 0) hittype[j].extra = 0; - if ( sj->picnum != RADIUSEXPLOSION && - s->owner >= 0 && sprite[s->owner].statnum < MAXSTATUS ) + if (sj->picnum != RADIUSEXPLOSION && + s->owner >= 0 && sprite[s->owner].statnum < MAXSTATUS) { if (sj->picnum == APLAYER) { @@ -501,7 +501,7 @@ int movesprite(short spritenum, long xchange, long ychange, long zchange, unsign bg = badguy(&sprite[spritenum]); - if (sprite[spritenum].statnum == 5 || (bg && sprite[spritenum].xrepeat < 4 ) ) + if (sprite[spritenum].statnum == 5 || (bg && sprite[spritenum].xrepeat < 4)) { sprite[spritenum].x += (xchange*TICSPERFRAME)>>2; sprite[spritenum].y += (ychange*TICSPERFRAME)>>2; @@ -517,18 +517,18 @@ int movesprite(short spritenum, long xchange, long ychange, long zchange, unsign h = ((tilesizy[sprite[spritenum].picnum]*sprite[spritenum].yrepeat)<<1); daz -= h; - if ( bg ) + if (bg) { oldx = sprite[spritenum].x; oldy = sprite[spritenum].y; - if ( sprite[spritenum].xrepeat > 60 ) + if (sprite[spritenum].xrepeat > 60) retval = clipmove(&sprite[spritenum].x,&sprite[spritenum].y,&daz,&dasectnum,((xchange*TICSPERFRAME)<<11),((ychange*TICSPERFRAME)<<11),1024L,(4<<8),(4<<8),cliptype); else { if (sprite[spritenum].picnum == LIZMAN) cd = 292L; - else if ( (actortype[sprite[spritenum].picnum]&3) ) + else if ((actortype[sprite[spritenum].picnum]&3)) cd = sprite[spritenum].clipdist<<2; else cd = 192L; @@ -536,25 +536,25 @@ int movesprite(short spritenum, long xchange, long ychange, long zchange, unsign retval = clipmove(&sprite[spritenum].x,&sprite[spritenum].y,&daz,&dasectnum,((xchange*TICSPERFRAME)<<11),((ychange*TICSPERFRAME)<<11),cd,(4<<8),(4<<8),cliptype); } - if ( dasectnum < 0 || ( dasectnum >= 0 && - ( ( hittype[spritenum].actorstayput >= 0 && hittype[spritenum].actorstayput != dasectnum ) || - ( ( sprite[spritenum].picnum == BOSS2 ) && sprite[spritenum].pal == 0 && sector[dasectnum].lotag != 3 ) || - ( ( sprite[spritenum].picnum == BOSS1 || sprite[spritenum].picnum == BOSS2 ) && sector[dasectnum].lotag == 1 ) || - ( sector[dasectnum].lotag == 1 && ( sprite[spritenum].picnum == LIZMAN || ( sprite[spritenum].picnum == LIZTROOP && sprite[spritenum].zvel == 0 ) ) ) - ) ) + if (dasectnum < 0 || (dasectnum >= 0 && + ((hittype[spritenum].actorstayput >= 0 && hittype[spritenum].actorstayput != dasectnum) || + ((sprite[spritenum].picnum == BOSS2) && sprite[spritenum].pal == 0 && sector[dasectnum].lotag != 3) || + ((sprite[spritenum].picnum == BOSS1 || sprite[spritenum].picnum == BOSS2) && sector[dasectnum].lotag == 1) || + (sector[dasectnum].lotag == 1 && (sprite[spritenum].picnum == LIZMAN || (sprite[spritenum].picnum == LIZTROOP && sprite[spritenum].zvel == 0))) + )) ) { sprite[spritenum].x = oldx; sprite[spritenum].y = oldy; if (sector[dasectnum].lotag == 1 && sprite[spritenum].picnum == LIZMAN) sprite[spritenum].ang = (TRAND&2047); - else if ( (hittype[spritenum].temp_data[0]&3) == 1 && sprite[spritenum].picnum != COMMANDER ) + else if ((hittype[spritenum].temp_data[0]&3) == 1 && sprite[spritenum].picnum != COMMANDER) sprite[spritenum].ang = (TRAND&2047); setsprite(spritenum,oldx,oldy,sprite[spritenum].z); if (dasectnum < 0) dasectnum = 0; return (16384+dasectnum); } - if ( (retval&49152) >= 32768 && (hittype[spritenum].cgg==0) ) sprite[spritenum].ang += 768; + if ((retval&49152) >= 32768 && (hittype[spritenum].cgg==0)) sprite[spritenum].ang += 768; } else { @@ -566,8 +566,8 @@ int movesprite(short spritenum, long xchange, long ychange, long zchange, unsign clipmove(&sprite[spritenum].x,&sprite[spritenum].y,&daz,&dasectnum,((xchange*TICSPERFRAME)<<11),((ychange*TICSPERFRAME)<<11),(long)(sprite[spritenum].clipdist<<2),(4<<8),(4<<8),cliptype); } - if ( dasectnum >= 0) - if ( (dasectnum != sprite[spritenum].sectnum) ) + if (dasectnum >= 0) + if ((dasectnum != sprite[spritenum].sectnum)) changespritesect(spritenum,dasectnum); daz = sprite[spritenum].z + ((zchange*TICSPERFRAME)>>3); if ((daz > hittype[spritenum].ceilingz) && (daz <= hittype[spritenum].floorz)) @@ -651,13 +651,13 @@ void guts(spritetype *s,short gtype, short n, short p) gutz = s->z-(8<<8); floorz = getflorzofslope(s->sectnum,s->x,s->y); - if ( gutz > ( floorz-(8<<8) ) ) + if (gutz > (floorz-(8<<8))) gutz = floorz-(8<<8); if (s->picnum == COMMANDER) gutz -= (24<<8); - if ( badguy(s) && s->pal == 6) + if (badguy(s) && s->pal == 6) pal = 6; else pal = 0; @@ -688,7 +688,7 @@ void gutsdir(spritetype *s,short gtype, short n, short p) gutz = s->z-(8<<8); floorz = getflorzofslope(s->sectnum,s->x,s->y); - if ( gutz > ( floorz-(8<<8) ) ) + if (gutz > (floorz-(8<<8))) gutz = floorz-(8<<8); if (s->picnum == COMMANDER) @@ -789,12 +789,12 @@ void movefta(void) ssect = psect = s->sectnum; - if (sprite[ps[p].i].extra > 0 ) + if (sprite[ps[p].i].extra > 0) { - if ( x < 30000 ) + if (x < 30000) { hittype[i].timetosleep++; - if ( hittype[i].timetosleep >= (x>>8) ) + if (hittype[i].timetosleep >= (x>>8)) { if (badguy(s)) { @@ -853,7 +853,7 @@ void movefta(void) else hittype[i].timetosleep = 0; } } - if ( badguy( s ) && checkspriteflags(i,SPRITE_FLAG_NOSHADE) == 0) + if (badguy(s) && checkspriteflags(i,SPRITE_FLAG_NOSHADE) == 0) { if (sector[s->sectnum].ceilingstat&1) s->shade = sector[s->sectnum].ceilingshade; @@ -871,7 +871,7 @@ short ifhitsectors(short sectnum) i = headspritestat[5]; while (i >= 0) { - if ( PN == EXPLOSION2 && sectnum == SECT ) + if (PN == EXPLOSION2 && sectnum == SECT) return i; i = nextspritestat[i]; } @@ -883,30 +883,30 @@ short ifhitbyweapon(short sn) short j,p; spritetype *npc; - if ( hittype[sn].extra >= 0 ) + if (hittype[sn].extra >= 0) { - if (sprite[sn].extra >= 0 ) + if (sprite[sn].extra >= 0) { npc = &sprite[sn]; if (npc->picnum == APLAYER) { - if (ud.god && hittype[sn].picnum != SHRINKSPARK ) return -1; + if (ud.god && hittype[sn].picnum != SHRINKSPARK) return -1; p = npc->yvel; j = hittype[sn].owner; - if ( j >= 0 && + if (j >= 0 && sprite[j].picnum == APLAYER && (gametype_flags[ud.coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY) && - ud.ffire == 0 ) + ud.ffire == 0) return -1; - if ( j >= 0 && + if (j >= 0 && sprite[j].picnum == APLAYER && (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) && ps[p].team == ps[sprite[j].yvel].team && - ud.ffire == 0 ) + ud.ffire == 0) return -1; npc->extra -= hittype[sn].extra; @@ -919,7 +919,7 @@ short ifhitbyweapon(short sn) ps[p].wackedbyactor = j; - if ( sprite[hittype[sn].owner].picnum == APLAYER && p != sprite[hittype[sn].owner].yvel ) + if (sprite[hittype[sn].owner].picnum == APLAYER && p != sprite[hittype[sn].owner].yvel) ps[p].frag_ps = sprite[j].yvel; hittype[sn].owner = ps[p].i; @@ -965,12 +965,12 @@ short ifhitbyweapon(short sn) } else { - if (hittype[sn].extra == 0 ) - if ( hittype[sn].picnum == SHRINKSPARK && npc->xrepeat < 24 ) + if (hittype[sn].extra == 0) + if (hittype[sn].picnum == SHRINKSPARK && npc->xrepeat < 24) return -1; npc->extra -= hittype[sn].extra; - if (npc->picnum != RECON && npc->owner >= 0 && sprite[npc->owner].statnum < MAXSTATUS ) + if (npc->picnum != RECON && npc->owner >= 0 && sprite[npc->owner].statnum < MAXSTATUS) npc->owner = hittype[sn].owner; } @@ -999,19 +999,19 @@ void movecyclers(void) j = t+(sintable[c[1]&2047]>>10); cshade = c[2]; - if ( j < cshade ) j = cshade; - else if ( j > t ) j = t; + if (j < cshade) j = cshade; + else if (j > t) j = t; c[1] += sector[s].extra; if (c[5]) { wal = &wall[sector[s].wallptr]; for (x = sector[s].wallnum;x>0;x--,wal++) - if ( wal->hitag != 1 ) + if (wal->hitag != 1) { wal->shade = j; - if ( (wal->cstat&2) && wal->nextwall >= 0) + if ((wal->cstat&2) && wal->nextwall >= 0) wall[wal->nextwall].shade = j; } @@ -1031,14 +1031,14 @@ void movedummyplayers(void) p = sprite[OW].yvel; - if ( ps[p].on_crane >= 0 || sector[ps[p].cursectnum].lotag != 1 || sprite[ps[p].i].extra <= 0 ) + if (ps[p].on_crane >= 0 || sector[ps[p].cursectnum].lotag != 1 || sprite[ps[p].i].extra <= 0) { ps[p].dummyplayersprite = -1; KILLIT(i); } else { - if (ps[p].on_ground && ps[p].on_warping_sector == 1 && sector[ps[p].cursectnum].lotag == 1 ) + if (ps[p].on_ground && ps[p].on_warping_sector == 1 && sector[ps[p].cursectnum].lotag == 1) { CS = 257; SZ = sector[SECT].ceilingz+(27<<8); @@ -1081,7 +1081,7 @@ void moveplayers(void) //Players p = &ps[s->yvel]; if (s->owner >= 0) { - if (p->newowner >= 0 ) //Looking thru the camera + if (p->newowner >= 0) //Looking thru the camera { s->x = p->oposx; s->y = p->oposy; @@ -1102,11 +1102,11 @@ void moveplayers(void) //Players execute(i,s->yvel,otherx); if (ud.multimode > 1) - if ( sprite[ps[otherp].i].extra > 0 ) + if (sprite[ps[otherp].i].extra > 0) { - if ( s->yrepeat > 32 && sprite[ps[otherp].i].yrepeat < 32) + if (s->yrepeat > 32 && sprite[ps[otherp].i].yrepeat < 32) { - if ( otherx < 1400 && p->knee_incs == 0 ) + if (otherx < 1400 && p->knee_incs == 0) { p->knee_incs = 1; p->weapon_pos = -1; @@ -1122,12 +1122,12 @@ void moveplayers(void) //Players } - if ( s->extra > 0 ) + if (s->extra > 0) { hittype[i].owner = i; if (ud.god == 0) - if ( ceilingspace(s->sectnum) || floorspace(s->sectnum) ) + if (ceilingspace(s->sectnum) || floorspace(s->sectnum)) quickkill(p); } else @@ -1139,7 +1139,7 @@ void moveplayers(void) //Players p->newowner = -1; - if ( p->wackedbyactor >= 0 && sprite[p->wackedbyactor].statnum < MAXSTATUS ) + if (p->wackedbyactor >= 0 && sprite[p->wackedbyactor].statnum < MAXSTATUS) { p->ang += getincangle(p->ang,getangle(sprite[p->wackedbyactor].x-p->posx,sprite[p->wackedbyactor].y-p->posy))>>1; p->ang &= 2047; @@ -1240,12 +1240,12 @@ void movefx(void) if (s->lotag >= 1000 && s->lotag < 2000) { x = ldist(&sprite[ps[screenpeek].i],s); - if ( x < ht && T1 == 0 ) + if (x < ht && T1 == 0) { - FX_SetReverb( s->lotag - 1000 ); + FX_SetReverb(s->lotag - 1000); T1 = 1; } - if ( x >= ht && T1 == 1 ) + if (x >= ht && T1 == 1) { FX_SetReverb(0); FX_SetReverbDelay(0); @@ -1254,17 +1254,17 @@ void movefx(void) } else if (s->lotag < 999 && (unsigned)sector[s->sectnum].lotag < 9 && AmbienceToggle && sector[SECT].floorz != sector[SECT].ceilingz) { - if ( (soundm[s->lotag]&2) ) + if ((soundm[s->lotag]&2)) { x = dist(&sprite[ps[screenpeek].i],s); - if ( x < ht && T1 == 0 && FX_VoiceAvailable(soundpr[s->lotag]-1) ) + if (x < ht && T1 == 0 && FX_VoiceAvailable(soundpr[s->lotag]-1)) { if (numenvsnds == NumVoices) { j = headspritestat[11]; while (j >= 0) { - if ( PN == MUSICANDSFX && j != i && sprite[j].lotag < 999 && hittype[j].temp_data[0] == 1 && dist(&sprite[j],&sprite[ps[screenpeek].i]) > x ) + if (PN == MUSICANDSFX && j != i && sprite[j].lotag < 999 && hittype[j].temp_data[0] == 1 && dist(&sprite[j],&sprite[ps[screenpeek].i]) > x) { stopenvsound(sprite[j].lotag,j); break; @@ -1276,17 +1276,17 @@ void movefx(void) spritesound(s->lotag,i); T1 = 1; } - if ( x >= ht && T1 == 1 ) + if (x >= ht && T1 == 1) { T1 = 0; stopenvsound(s->lotag,i); } } - if ( (soundm[s->lotag]&16) ) + if ((soundm[s->lotag]&16)) { if (T5 > 0) T5--; else for (p=connecthead;p>=0;p=connectpoint2[p]) - if ( p == myconnectindex && ps[p].cursectnum == s->sectnum ) + if (p == myconnectindex && ps[p].cursectnum == s->sectnum) { j = s->lotag+((unsigned)global_random%(s->hitag+1)); sound(j); @@ -1315,14 +1315,14 @@ void movefallers(void) sect = s->sectnum; - if ( T1 == 0 ) + if (T1 == 0) { s->z -= (16<<8); T2 = s->ang; x = s->extra; IFHIT { - if ( j == FIREEXT || j == RPG || j == RADIUSEXPLOSION || j == SEENINE || j == OOZFILTER ) + if (j == FIREEXT || j == RPG || j == RADIUSEXPLOSION || j == SEENINE || j == OOZFILTER) { if (s->extra <= 0) { @@ -1363,13 +1363,13 @@ void movefallers(void) } else { - if ( s->xvel > 0) + if (s->xvel > 0) { s->xvel -= 8; ssp(i,CLIPMASK0); } - if ( floorspace(s->sectnum) ) x = 0; + if (floorspace(s->sectnum)) x = 0; else { if (ceilingspace(s->sectnum)) @@ -1378,14 +1378,14 @@ void movefallers(void) x = gc; } - if ( s->z < (sector[sect].floorz-FOURSLEIGHT) ) + if (s->z < (sector[sect].floorz-FOURSLEIGHT)) { s->zvel += x; if (s->zvel > 6144) s->zvel = 6144; s->z += s->zvel; } - if ( (sector[sect].floorz-s->z) < (16<<8) ) + if ((sector[sect].floorz-s->z) < (16<<8)) { j = 1+(TRAND&7); for (x=0;xsectnum; - if ( sect < 0 ) KILLIT(i); + if (sect < 0) KILLIT(i); hittype[i].bposx = s->x; hittype[i].bposy = s->y; @@ -1428,13 +1428,13 @@ void movestandables(void) if (s->xvel) getglobalz(i); - if ( t[0] == 0 ) //Waiting to check the sector + if (t[0] == 0) //Waiting to check the sector { j = headspritesect[t[1]]; while (j>=0) { nextj = nextspritesect[j]; - switch ( sprite[j].statnum ) + switch (sprite[j].statnum) { case 1: case 2: @@ -1451,7 +1451,7 @@ void movestandables(void) else if (t[0]==1) { - if ( s->xvel < 184 ) + if (s->xvel < 184) { s->picnum = CRANE+1; s->xvel += 8; @@ -1466,15 +1466,15 @@ void movestandables(void) if (t[0]==2) { - if ( (sector[sect].floorz - s->z) < (64<<8) ) + if ((sector[sect].floorz - s->z) < (64<<8)) if (s->picnum > CRANE) s->picnum--; - if ( (sector[sect].floorz - s->z) < (4096+1024)) + if ((sector[sect].floorz - s->z) < (4096+1024)) t[0]++; } if (t[0]==7) { - if ( (sector[sect].floorz - s->z) < (64<<8) ) + if ((sector[sect].floorz - s->z) < (64<<8)) { if (s->picnum > CRANE) s->picnum--; else @@ -1495,7 +1495,7 @@ void movestandables(void) else if (t[0]==3) { s->picnum++; - if ( s->picnum == (CRANE+2) ) + if (s->picnum == (CRANE+2)) { p = checkcursectnums(t[1]); if (p >= 0 && ps[p].on_ground) @@ -1510,7 +1510,7 @@ void movestandables(void) j = headspritesect[t[1]]; while (j>=0) { - switch ( sprite[j].statnum ) + switch (sprite[j].statnum) { case 1: case 6: @@ -1535,7 +1535,7 @@ void movestandables(void) else if (t[0]==5 || t[0] == 8) { if (t[0]==8 && s->picnum < (CRANE+2)) - if ( (sector[sect].floorz-s->z) > 8192) + if ((sector[sect].floorz-s->z) > 8192) s->picnum++; if (s->z < msx[t[4]+2]) @@ -1548,11 +1548,11 @@ void movestandables(void) } else if (t[0]==6) { - if ( s->xvel < 192 ) + if (s->xvel < 192) s->xvel += 8; s->ang = getangle(msx[t[4]]-s->x,msy[t[4]]-s->y); ssp(i,CLIPMASK0); - if ( ((s->x-msx[t[4]])*(s->x-msx[t[4]])+(s->y-msy[t[4]])*(s->y-msy[t[4]]) ) < (128*128) ) + if (((s->x-msx[t[4]])*(s->x-msx[t[4]])+(s->y-msy[t[4]])*(s->y-msy[t[4]])) < (128*128)) t[0]++; } @@ -1602,13 +1602,13 @@ void movestandables(void) { if (t[0] > 0) { - if ( t[0] < 20 ) + if (t[0] < 20) { t[0]++; s->picnum++; - if ( s->picnum == ( WATERFOUNTAIN+3 ) ) + if (s->picnum == (WATERFOUNTAIN+3)) s->picnum = WATERFOUNTAIN+1; } else @@ -1626,14 +1626,14 @@ void movestandables(void) goto BOLT; } - if ( AFLAMABLE(s->picnum) ) + if (AFLAMABLE(s->picnum)) { if (T1 == 1) { T2++; - if ( (T2&3) > 0) goto BOLT; + if ((T2&3) > 0) goto BOLT; - if ( s->picnum == TIRE && T2 == 32 ) + if (s->picnum == TIRE && T2 == 32) { s->cstat = 0; j = spawn(i,BLOODPOOL); @@ -1694,7 +1694,7 @@ void movestandables(void) spritesound(LASERTRIP_EXPLODE,i); for (j=0;j<5;j++) RANDOMSCRAP; x = s->extra; - hitradius( i, tripbombblastradius, x>>2,x>>1,x-(x>>2),x); + hitradius(i, tripbombblastradius, x>>2,x>>1,x-(x>>2),x); j = spawn(i,EXPLOSION2); sprite[j].ang = s->ang; @@ -1722,13 +1722,13 @@ void movestandables(void) s->ang = l; } - if ( T1 < 32 ) + if (T1 < 32) { p = findplayer(s,&x); - if ( x > 768 ) T1++; + if (x > 768) T1++; else if (T1 > 16) T1++; } - if ( T1 == 32 ) + if (T1 == 32) { l = s->ang; s->ang = T6; @@ -1762,7 +1762,7 @@ void movestandables(void) s->x += sintable[(T6+512)&2047]>>4; s->y += sintable[(T6)&2047]>>4; - if ( x < 1024 ) + if (x < 1024) { sprite[j].xrepeat = x>>5; break; @@ -1802,7 +1802,7 @@ void movestandables(void) setsprite(i,s->x,s->y,s->z); // if( hittype[i].lastvx != x && lTripBombControl & TRIPBOMB_TRIPWIRE) - if ( hittype[i].lastvx != x && hittype[i].temp_data[6] != 1) + if (hittype[i].lastvx != x && hittype[i].temp_data[6] != 1) { hittype[i].temp_data[6] = 3; T3 = 13; @@ -1813,19 +1813,19 @@ void movestandables(void) } - if ( s->picnum >= CRACK1 && s->picnum <= CRACK4 ) + if (s->picnum >= CRACK1 && s->picnum <= CRACK4) { if (s->hitag > 0) { t[0] = s->cstat; t[1] = s->ang; j = ifhitbyweapon(i); - if (j == FIREEXT || j == RPG || j == RADIUSEXPLOSION || j == SEENINE || j == OOZFILTER ) + if (j == FIREEXT || j == RPG || j == RADIUSEXPLOSION || j == SEENINE || j == OOZFILTER) { j = headspritestat[6]; while (j >= 0) { - if (s->hitag == sprite[j].hitag && ( sprite[j].picnum == OOZFILTER || sprite[j].picnum == SEENINE ) ) + if (s->hitag == sprite[j].hitag && (sprite[j].picnum == OOZFILTER || sprite[j].picnum == SEENINE)) if (sprite[j].shade != -32) sprite[j].shade = -32; j = nextspritestat[j]; @@ -1843,10 +1843,10 @@ void movestandables(void) goto BOLT; } - if ( s->picnum == FIREEXT ) + if (s->picnum == FIREEXT) { j = ifhitbyweapon(i); - if ( j == -1 ) goto BOLT; + if (j == -1) goto BOLT; for (k=0;k<16;k++) { @@ -1863,7 +1863,7 @@ void movestandables(void) j = headspritestat[6]; while (j >= 0) { - if (s->hitag == sprite[j].hitag && ( sprite[j].picnum == OOZFILTER || sprite[j].picnum == SEENINE ) ) + if (s->hitag == sprite[j].hitag && (sprite[j].picnum == OOZFILTER || sprite[j].picnum == SEENINE)) if (sprite[j].shade != -32) sprite[j].shade = -32; j = nextspritestat[j]; @@ -1871,7 +1871,7 @@ void movestandables(void) x = s->extra; spawn(i,EXPLOSION2); - hitradius( i, pipebombblastradius,x>>2, x-(x>>1),x-(x>>2), x); + hitradius(i, pipebombblastradius,x>>2, x-(x>>1),x-(x>>2), x); spritesound(PIPEBOMB_EXPLODE,i); goto DETONATE; @@ -1884,7 +1884,7 @@ void movestandables(void) goto BOLT; } - if (s->picnum == OOZFILTER || s->picnum == SEENINE || s->picnum == SEENINEDEAD || s->picnum == (SEENINEDEAD+1) ) + if (s->picnum == OOZFILTER || s->picnum == SEENINE || s->picnum == SEENINEDEAD || s->picnum == (SEENINEDEAD+1)) { if (s->shade != -32 && s->shade != -33) { @@ -1893,7 +1893,7 @@ void movestandables(void) else j = 0; - if ( j || s->shade == -31 ) + if (j || s->shade == -31) { if (j) s->lotag = 0; @@ -1902,7 +1902,7 @@ void movestandables(void) j = headspritestat[6]; while (j >= 0) { - if (s->hitag == sprite[j].hitag && ( sprite[j].picnum == SEENINE || sprite[j].picnum == OOZFILTER ) ) + if (s->hitag == sprite[j].hitag && (sprite[j].picnum == SEENINE || sprite[j].picnum == OOZFILTER)) sprite[j].shade = -32; j = nextspritestat[j]; } @@ -1922,17 +1922,17 @@ void movestandables(void) } else { - if ( s->xrepeat > 0 ) + if (s->xrepeat > 0) { T3++; if (T3 == 3) { - if ( s->picnum == OOZFILTER ) + if (s->picnum == OOZFILTER) { T3 = 0; goto DETONATE; } - if ( s->picnum != (SEENINEDEAD+1) ) + if (s->picnum != (SEENINEDEAD+1)) { T3 = 0; @@ -1952,11 +1952,11 @@ DETONATE: j = headspritestat[3]; while (j >= 0) { - if ( s->hitag == sprite[j].hitag ) + if (s->hitag == sprite[j].hitag) { if (sprite[j].lotag == 13) { - if ( hittype[j].temp_data[2] == 0 ) + if (hittype[j].temp_data[2] == 0) hittype[j].temp_data[2] = 1; } else if (sprite[j].lotag == 8) @@ -1974,11 +1974,11 @@ DETONATE: s->z -= (32<<8); - if ( ( t[3] == 1 && s->xrepeat ) || s->lotag == -99 ) + if ((t[3] == 1 && s->xrepeat) || s->lotag == -99) { x = s->extra; spawn(i,EXPLOSION2); - hitradius( i,seenineblastradius,x>>2, x-(x>>1),x-(x>>2), x); + hitradius(i,seenineblastradius,x>>2, x-(x>>1),x-(x>>2), x); spritesound(PIPEBOMB_EXPLODE,i); } @@ -2053,12 +2053,12 @@ DETONATE: p = findplayer(s, &x); - if ( x < 2048 ) + if (x < 2048) { - if ( SP == 1 ) + if (SP == 1) camsprite = i; } - else if ( camsprite != -1 && T1 == 1) + else if (camsprite != -1 && T1 == 1) { camsprite = -1; T1 = 0; @@ -2076,7 +2076,7 @@ DETONATE: { makeitfall(i); if (TRAND&1) s->zvel -= 256; - if ( klabs(s->xvel) < 48 ) + if (klabs(s->xvel) < 48) s->xvel += (TRAND&3); } else KILLIT(i); @@ -2087,7 +2087,7 @@ DETONATE: // case SIDEBOLT1+2: // case SIDEBOLT1+3: p = findplayer(s, &x); - if ( x > 20480 ) goto BOLT; + if (x > 20480) goto BOLT; CLEAR_THE_BOLT2: if (t[2]) @@ -2095,12 +2095,12 @@ CLEAR_THE_BOLT2: t[2]--; goto BOLT; } - if ( (s->xrepeat|s->yrepeat) == 0 ) + if ((s->xrepeat|s->yrepeat) == 0) { s->xrepeat=t[0]; s->yrepeat=t[1]; } - if ( (TRAND&8) == 0 ) + if ((TRAND&8) == 0) { t[0]=s->xrepeat; t[1]=s->yrepeat; @@ -2112,7 +2112,7 @@ CLEAR_THE_BOLT2: if (l&1) s->cstat ^= 2; - if ( (TRAND&1) && sector[sect].floorpicnum == HURTRAIL ) + if ((TRAND&1) && sector[sect].floorpicnum == HURTRAIL) spritesound(SHORT_CIRCUIT,i); if (s->picnum == SIDEBOLT1+4) s->picnum = SIDEBOLT1; @@ -2124,9 +2124,9 @@ CLEAR_THE_BOLT2: // case BOLT1+2: // case BOLT1+3: p = findplayer(s, &x); - if ( x > 20480 ) goto BOLT; + if (x > 20480) goto BOLT; - if ( t[3] == 0 ) + if (t[3] == 0) t[3]=sector[sect].floorshade; CLEAR_THE_BOLT: @@ -2137,12 +2137,12 @@ CLEAR_THE_BOLT: sector[sect].ceilingshade = 20; goto BOLT; } - if ( (s->xrepeat|s->yrepeat) == 0 ) + if ((s->xrepeat|s->yrepeat) == 0) { s->xrepeat=t[0]; s->yrepeat=t[1]; } - else if ( (TRAND&8) == 0 ) + else if ((TRAND&8) == 0) { t[0]=s->xrepeat; t[1]=s->yrepeat; @@ -2157,7 +2157,7 @@ CLEAR_THE_BOLT: if (l&1) s->cstat ^= 2; - if ( s->picnum == (BOLT1+1) && (TRAND&7) == 0 && sector[sect].floorpicnum == HURTRAIL ) + if (s->picnum == (BOLT1+1) && (TRAND&7) == 0 && sector[sect].floorpicnum == HURTRAIL) spritesound(SHORT_CIRCUIT,i); if (s->picnum==BOLT1+4) s->picnum=BOLT1; @@ -2176,7 +2176,7 @@ CLEAR_THE_BOLT: case WATERDRIP__STATIC: - if ( t[1] ) + if (t[1]) { t[1]--; if (t[1] == 0) @@ -2218,7 +2218,7 @@ CLEAR_THE_BOLT: goto BOLT; case TOUCHPLATE__STATIC: - if ( t[1] == 1 && s->hitag >= 0) //Move the sector floor + if (t[1] == 1 && s->hitag >= 0) //Move the sector floor { x = sector[sect].floorz; @@ -2257,9 +2257,9 @@ CLEAR_THE_BOLT: if (t[5] == 1) goto BOLT; p = checkcursectnums(sect); - if ( p >= 0 && ( ps[p].on_ground || s->ang == 512) ) + if (p >= 0 && (ps[p].on_ground || s->ang == 512)) { - if ( t[0] == 0 && !check_activator_motion(s->lotag) ) + if (t[0] == 0 && !check_activator_motion(s->lotag)) { t[0] = 1; t[1] = 1; @@ -2349,7 +2349,7 @@ void bounce(short i) k = sector[hitsect].wallptr; l = wall[k].point2; daang = getangle(wall[l].x-wall[k].x,wall[l].y-wall[k].y); - if ( s->z < (hittype[i].floorz+hittype[i].ceilingz)>>1) + if (s->z < (hittype[i].floorz+hittype[i].ceilingz)>>1) k = sector[hitsect].ceilingheinum; else k = sector[hitsect].floorheinum; @@ -2457,7 +2457,7 @@ void moveweapons(void) { if (thisprojectile[i].workslike & PROJECTILE_FLAG_EXPLODEONTIMER) { - if (thisprojectile[i].spawns >= 0 ) + if (thisprojectile[i].spawns >= 0) { k = spawn(i,thisprojectile[i].spawns); sprite[k].x = dax; @@ -2476,7 +2476,7 @@ void moveweapons(void) s->extra += (TRAND&thisprojectile[i].extra_rand); x = s->extra; - hitradius( i,thisprojectile[i].hitradius, x>>2,x>>1,x-(x>>2),x); + hitradius(i,thisprojectile[i].hitradius, x>>2,x>>1,x-(x>>2),x); } KILLIT(i); } @@ -2489,7 +2489,7 @@ void moveweapons(void) if (s->yvel < 1) { - if (thisprojectile[i].spawns >= 0 ) + if (thisprojectile[i].spawns >= 0) { k = spawn(i,thisprojectile[i].spawns); sprite[k].x = dax; @@ -2508,7 +2508,7 @@ void moveweapons(void) s->extra += (TRAND&thisprojectile[i].extra_rand); x = s->extra; - hitradius( i,thisprojectile[i].hitradius, x>>2,x>>1,x-(x>>2),x); + hitradius(i,thisprojectile[i].hitradius, x>>2,x>>1,x-(x>>2),x); KILLIT(i); } @@ -2526,12 +2526,12 @@ void moveweapons(void) if (!(thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0) - if ( FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256 ) + if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256) j = 49152|s->yvel; if (s->sectnum < 0) { KILLIT(i); } - if ( (j&49152) != 49152) + if ((j&49152) != 49152) if (!(thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS)) { if (s->z < hittype[i].ceilingz) @@ -2540,8 +2540,8 @@ void moveweapons(void) s->zvel = -1; } else - if ( ( s->z > hittype[i].floorz && sector[s->sectnum].lotag != 1 ) || - ( s->z > hittype[i].floorz+(16<<8) && sector[s->sectnum].lotag == 1 ) ) + if ((s->z > hittype[i].floorz && sector[s->sectnum].lotag != 1) || + (s->z > hittype[i].floorz+(16<<8) && sector[s->sectnum].lotag == 1)) { j = 16384|(s->sectnum); if (sector[s->sectnum].lotag != 1) @@ -2573,7 +2573,7 @@ void moveweapons(void) if (thisprojectile[i].workslike & PROJECTILE_FLAG_WATERBUBBLES && sector[s->sectnum].lotag == 2 && rnd(140)) spawn(i,WATERBUBBLE); - if ( j != 0 ) + if (j != 0) { if (thisprojectile[i].workslike & PROJECTILE_FLAG_COOLEXPLOSION1) { @@ -2583,7 +2583,7 @@ void moveweapons(void) s->zvel = 0; } - if ( (j&49152) == 49152 ) + if ((j&49152) == 49152) { j &= (MAXSPRITES-1); @@ -2600,7 +2600,7 @@ void moveweapons(void) if (thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFSPRITES) { - if ( wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR ) + if (wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR) s->yvel--; k = getangle( @@ -2655,7 +2655,7 @@ void moveweapons(void) hittype[j].picnum = s->picnum; hittype[j].extra += thisprojectile[i].extra; - if (thisprojectile[i].spawns >= 0 ) + if (thisprojectile[i].spawns >= 0) { k = spawn(i,thisprojectile[i].spawns); sprite[k].x = dax; @@ -2674,11 +2674,11 @@ void moveweapons(void) } } - else if ( (j&49152) == 32768 ) + else if ((j&49152) == 32768) { j &= (MAXWALLS-1); - if (thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFMIRRORS && ( wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR ) ) + if (thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFMIRRORS && (wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR)) { k = getangle( wall[wall[j].point2].x-wall[j].x, @@ -2695,7 +2695,7 @@ void moveweapons(void) if (thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) { - if ( wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR ) + if (wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR) s->yvel--; k = getangle( @@ -2715,13 +2715,13 @@ void moveweapons(void) } } } - else if ( (j&49152) == 16384) + else if ((j&49152) == 16384) { setsprite(i,dax,day,daz); if (s->zvel < 0) { - if ( sector[s->sectnum].ceilingstat&1 ) + if (sector[s->sectnum].ceilingstat&1) if (sector[s->sectnum].ceilingpal == 0) KILLIT(i); @@ -2803,7 +2803,7 @@ void moveweapons(void) s->extra += (TRAND&thisprojectile[i].extra_rand); x = s->extra; - hitradius( i,thisprojectile[i].hitradius, x>>2,x>>1,x-(x>>2),x); + hitradius(i,thisprojectile[i].hitradius, x>>2,x>>1,x-(x>>2),x); /* } else { @@ -2861,7 +2861,7 @@ void moveweapons(void) s->z+((k*ksgn(s->zvel))*klabs(s->zvel/12)),INNERJAW,-40, 32,32,0,0,0,i,5); sprite[q].cstat = 128; - if ( T2 > 512 && T2 < (1024) ) + if (T2 > 512 && T2 < (1024)) sprite[q].picnum = INNERJAW+1; goto BOLT; @@ -2881,8 +2881,8 @@ void moveweapons(void) case SPIT__STATIC: case COOLEXPLOSION1__STATIC: - if ( s->picnum == COOLEXPLOSION1 ) - if ( !issoundplaying(i,WIERDSHOT_FLY) ) + if (s->picnum == COOLEXPLOSION1) + if (!issoundplaying(i,WIERDSHOT_FLY)) spritesound(WIERDSHOT_FLY,i); p = -1; @@ -2919,12 +2919,12 @@ void moveweapons(void) (k*(sintable[s->ang&2047]))>>14,ll,qq); if (s->picnum == RPG && s->yvel >= 0) - if ( FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256 ) + if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256) j = 49152|s->yvel; if (s->sectnum < 0) { KILLIT(i); } - if ( (j&49152) != 49152) + if ((j&49152) != 49152) if (s->picnum != FREEZEBLAST) { if (s->z < hittype[i].ceilingz) @@ -2933,8 +2933,8 @@ void moveweapons(void) s->zvel = -1; } else - if ( ( s->z > hittype[i].floorz && sector[s->sectnum].lotag != 1 ) || - ( s->z > hittype[i].floorz+(16<<8) && sector[s->sectnum].lotag == 1 ) ) + if ((s->z > hittype[i].floorz && sector[s->sectnum].lotag != 1) || + (s->z > hittype[i].floorz+(16<<8) && sector[s->sectnum].lotag == 1)) { j = 16384|(s->sectnum); if (sector[s->sectnum].lotag != 1) @@ -2959,22 +2959,22 @@ void moveweapons(void) else if (s->picnum == SPIT) if (s->zvel < 6144) s->zvel += gc-112; - if ( j != 0 ) + if (j != 0) { if (s->picnum == COOLEXPLOSION1) { - if ( (j&49152) == 49152 && sprite[j&(MAXSPRITES-1)].picnum != APLAYER) + if ((j&49152) == 49152 && sprite[j&(MAXSPRITES-1)].picnum != APLAYER) goto BOLT; s->xvel = 0; s->zvel = 0; } - if ( (j&49152) == 49152 ) + if ((j&49152) == 49152) { j &= (MAXSPRITES-1); - if (s->picnum == FREEZEBLAST && sprite[j].pal == 1 ) - if ( badguy(&sprite[j]) || sprite[j].picnum == APLAYER ) + if (s->picnum == FREEZEBLAST && sprite[j].pal == 1) + if (badguy(&sprite[j]) || sprite[j].picnum == APLAYER) { j = spawn(i,TRANSPORTERSTAR); sprite[j].pal = 1; @@ -3013,11 +3013,11 @@ void moveweapons(void) } } } - else if ( (j&49152) == 32768 ) + else if ((j&49152) == 32768) { j &= (MAXWALLS-1); - if (s->picnum != RPG && s->picnum != FREEZEBLAST && s->picnum != SPIT && ( wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR ) ) + if (s->picnum != RPG && s->picnum != FREEZEBLAST && s->picnum != SPIT && (wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR)) { k = getangle( wall[wall[j].point2].x-wall[j].x, @@ -3034,7 +3034,7 @@ void moveweapons(void) if (s->picnum == FREEZEBLAST) { - if ( wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR ) + if (wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR) { s->extra >>= 1; s->yvel--; @@ -3048,13 +3048,13 @@ void moveweapons(void) } } } - else if ( (j&49152) == 16384) + else if ((j&49152) == 16384) { setsprite(i,dax,day,daz); if (s->zvel < 0) { - if ( sector[s->sectnum].ceilingstat&1 ) + if (sector[s->sectnum].ceilingstat&1) if (sector[s->sectnum].ceilingpal == 0) KILLIT(i); @@ -3089,9 +3089,9 @@ void moveweapons(void) sprite[k].xrepeat = 6; sprite[k].yrepeat = 6; } - else if ( (j&49152) == 16384) + else if ((j&49152) == 16384) { - if ( s->zvel > 0) + if (s->zvel > 0) spawn(i,EXPLOSION2BOT); else { sprite[k].cstat |= 8; sprite[k].z += (48<<8); } @@ -3103,30 +3103,30 @@ void moveweapons(void) spritesound(SHRINKER_HIT,i); hitradius(i,shrinkerblastradius,0,0,0,0); } - else if ( s->picnum != COOLEXPLOSION1 && s->picnum != FREEZEBLAST && s->picnum != FIRELASER) + else if (s->picnum != COOLEXPLOSION1 && s->picnum != FREEZEBLAST && s->picnum != FIRELASER) { k = spawn(i,EXPLOSION2); sprite[k].xrepeat = sprite[k].yrepeat = s->xrepeat>>1; - if ( (j&49152) == 16384) + if ((j&49152) == 16384) { - if ( s->zvel < 0) + if (s->zvel < 0) { sprite[k].cstat |= 8; sprite[k].z += (72<<8); } } } - if ( s->picnum == RPG ) + if (s->picnum == RPG) { spritesound(RPG_EXPLODE,i); if (s->xrepeat >= 10) { x = s->extra; - hitradius( i,rpgblastradius, x>>2,x>>1,x-(x>>2),x); + hitradius(i,rpgblastradius, x>>2,x>>1,x-(x>>2),x); } else { x = s->extra+(global_random&3); - hitradius( i,(rpgblastradius>>1),x>>2,x>>1,x-(x>>2),x); + hitradius(i,(rpgblastradius>>1),x>>2,x>>1,x-(x>>2),x); } } } @@ -3188,15 +3188,15 @@ void movetransports(void) { case 10: // Player - if ( sprite[j].owner != -1 ) + if (sprite[j].owner != -1) { p = sprite[j].yvel; ps[p].on_warping_sector = 1; - if ( ps[p].transporter_hold == 0 && ps[p].jumping_counter == 0 ) + if (ps[p].transporter_hold == 0 && ps[p].jumping_counter == 0) { - if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0 ) + if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0) { if (sprite[i].pal == 0) { @@ -3236,16 +3236,16 @@ void movetransports(void) break; } } - else if ( !(sectlotag == 1 && ps[p].on_ground == 1) ) break; + else if (!(sectlotag == 1 && ps[p].on_ground == 1)) break; - if (onfloorz == 0 && klabs(SZ-ps[p].posz) < 6144 ) - if ( (ps[p].jetpack_on == 0 ) || (ps[p].jetpack_on && (sync[p].bits&1) ) || - (ps[p].jetpack_on && (sync[p].bits&2) ) ) + if (onfloorz == 0 && klabs(SZ-ps[p].posz) < 6144) + if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (sync[p].bits&1)) || + (ps[p].jetpack_on && (sync[p].bits&2))) { ps[p].oposx = ps[p].posx += sprite[OW].x-SX; ps[p].oposy = ps[p].posy += sprite[OW].y-SY; - if ( ps[p].jetpack_on && ( (sync[p].bits&1) || ps[p].jetpack_on < 11 ) ) + if (ps[p].jetpack_on && ((sync[p].bits&1) || ps[p].jetpack_on < 11)) ps[p].posz = sprite[OW].z-6144; else ps[p].posz = sprite[OW].z+6144; ps[p].oposz = ps[p].posz; @@ -3262,7 +3262,7 @@ void movetransports(void) k = 0; - if ( onfloorz && sectlotag == 1 && ps[p].on_ground && ps[p].posz > (sector[sect].floorz-1080) && ( (sync[p].bits&2) || ps[p].poszv > 2048 ) ) + if (onfloorz && sectlotag == 1 && ps[p].on_ground && ps[p].posz > (sector[sect].floorz-1080) && ((sync[p].bits&2) || ps[p].poszv > 2048)) // if( onfloorz && sectlotag == 1 && ps[p].posz > (sector[sect].floorz-(6<<8)) ) { k = 1; @@ -3281,7 +3281,7 @@ void movetransports(void) // ps[p].poszv += 1080; } - if ( onfloorz && sectlotag == 2 && ps[p].posz < (sector[sect].ceilingz+1080) && ps[p].poszv == 0) + if (onfloorz && sectlotag == 2 && ps[p].posz < (sector[sect].ceilingz+1080) && ps[p].poszv == 0) { k = 1; // if( sprite[j].extra <= 0) break; @@ -3314,7 +3314,7 @@ void movetransports(void) setpal(&ps[p]); - if ( (TRAND&255) < 32 ) + if ((TRAND&255) < 32) spawn(j,WATERSPLASH2); if (sectlotag == 1) @@ -3328,7 +3328,7 @@ void movetransports(void) break; case 1: - if ( (sprite[j].picnum == SHARK) + if ((sprite[j].picnum == SHARK) || (sprite[j].picnum == COMMANDER) || (sprite[j].picnum == OCTABRAIN) || ((sprite[j].picnum >= GREENSLIME) && (sprite[j].picnum >= GREENSLIME+7)) @@ -3345,15 +3345,15 @@ void movetransports(void) { warpspriteto = 0; - if ( ll && sectlotag == 2 && sprite[j].z < (sector[sect].ceilingz+ll) ) + if (ll && sectlotag == 2 && sprite[j].z < (sector[sect].ceilingz+ll)) warpspriteto = 1; - if ( ll && sectlotag == 1 && sprite[j].z > (sector[sect].floorz-ll) ) + if (ll && sectlotag == 1 && sprite[j].z > (sector[sect].floorz-ll)) warpspriteto = 1; - if ( sectlotag == 0 && ( onfloorz || klabs(sprite[j].z-SZ) < 4096) ) + if (sectlotag == 0 && (onfloorz || klabs(sprite[j].z-SZ) < 4096)) { - if ( sprite[OW].owner != OW && onfloorz && T1 > 0 && sprite[j].statnum != 5 ) + if (sprite[OW].owner != OW && onfloorz && T1 > 0 && sprite[j].statnum != 5) { T1++; goto BOLT; @@ -3363,7 +3363,7 @@ void movetransports(void) if (warpspriteto && checkspriteflags(j,SPRITE_FLAG_DECAL)) goto JBOLT; - if ( warpspriteto ) switch (dynamictostatic[sprite[j].picnum]) + if (warpspriteto) switch (dynamictostatic[sprite[j].picnum]) { case TRANSPORTERSTAR__STATIC: case TRANSPORTERBEAM__STATIC: @@ -3384,7 +3384,7 @@ void movetransports(void) break; } default: - if (sprite[j].statnum == 5 && !(sectlotag == 1 || sectlotag == 2) ) + if (sprite[j].statnum == 5 && !(sectlotag == 1 || sectlotag == 2)) break; case WATERBUBBLE__STATIC: @@ -3394,7 +3394,7 @@ void movetransports(void) if (sectlotag > 0) { k = spawn(j,WATERSPLASH2); - if ( sectlotag == 1 && sprite[j].statnum == 4 ) + if (sectlotag == 1 && sprite[j].statnum == 4) { sprite[k].xvel = sprite[j].xvel>>1; sprite[k].ang = sprite[j].ang; @@ -3407,7 +3407,7 @@ void movetransports(void) case 0: if (onfloorz) { - if ( sprite[j].statnum == 4 || ( checkcursectnums(sect) == -1 && checkcursectnums(sprite[OW].sectnum) == -1 ) ) + if (sprite[j].statnum == 4 || (checkcursectnums(sect) == -1 && checkcursectnums(sprite[OW].sectnum) == -1)) { sprite[j].x += (sprite[OW].x-SX); sprite[j].y += (sprite[OW].y-SY); @@ -3427,7 +3427,7 @@ void movetransports(void) spritesound(TELEPORTER,k); } - if ( sprite[OW].owner != OW ) + if (sprite[OW].owner != OW) { T1 = 13; hittype[OW].temp_data[0] = 13; @@ -3506,7 +3506,7 @@ void moveactors(void) sect = s->sectnum; - if ( s->xrepeat == 0 || sect < 0 || sect >= MAXSECTORS) + if (s->xrepeat == 0 || sect < 0 || sect >= MAXSECTORS) KILLIT(i); t = &hittype[i].temp_data[0]; @@ -3535,7 +3535,7 @@ void moveactors(void) else { j = ifhitbyweapon(i); - if ( j >= 0 ) + if (j >= 0) { s->cstat = 32+128; k = 1; @@ -3543,11 +3543,11 @@ void moveactors(void) j = headspritestat[1]; while (j >= 0) { - if ( sprite[j].lotag == s->lotag && - sprite[j].picnum == s->picnum ) + if (sprite[j].lotag == s->lotag && + sprite[j].picnum == s->picnum) { - if ( ( sprite[j].hitag && !(sprite[j].cstat&32) ) || - ( !sprite[j].hitag && (sprite[j].cstat&32) ) + if ((sprite[j].hitag && !(sprite[j].cstat&32)) || + (!sprite[j].hitag && (sprite[j].cstat&32)) ) { k = 0; @@ -3576,9 +3576,9 @@ void moveactors(void) { KILLIT(i); } - if ( T1 >= (respawnitemtime>>1) && T1 < ((respawnitemtime>>1)+(respawnitemtime>>2)) ) + if (T1 >= (respawnitemtime>>1) && T1 < ((respawnitemtime>>1)+(respawnitemtime>>2))) PN = RESPAWNMARKERYELLOW; - else if ( T1 > ((respawnitemtime>>1)+(respawnitemtime>>2)) ) + else if (T1 > ((respawnitemtime>>1)+(respawnitemtime>>2))) PN = RESPAWNMARKERGREEN; makeitfall(i); break; @@ -3591,7 +3591,7 @@ void moveactors(void) if (t[0] == 4) spritesound(WAR_AMBIENCE2,i); - if ( t[0] > (26*8) ) + if (t[0] > (26*8)) { sound(RPG_EXPLODE); for (j=0;j<32;j++) RANDOMSCRAP; @@ -3606,7 +3606,7 @@ void moveactors(void) makeitfall(i); IFMOVING { - if ( (TRAND&255) < 3 ) spritesound(RATTY,i); + if ((TRAND&255) < 3) spritesound(RATTY,i); s->ang += (TRAND&31)-15+(sintable[(t[0]<<8)&2047]>>11); } else @@ -3627,7 +3627,7 @@ void moveactors(void) while (j >= 0) { nextj = nextspritestat[j]; - if ( sprite[j].picnum == POCKET && ldist(&sprite[j],s) < 52 ) KILLIT(i); + if (sprite[j].picnum == POCKET && ldist(&sprite[j],s) < 52) KILLIT(i); j = nextj; } @@ -3638,7 +3638,7 @@ void moveactors(void) if (j&49152) { - if ( (j&49152) == 32768 ) + if ((j&49152) == 32768) { j &= (MAXWALLS-1); k = getangle( @@ -3646,7 +3646,7 @@ void moveactors(void) wall[wall[j].point2].y-wall[j].y); s->ang = ((k<<1) - s->ang)&2047; } - else if ( (j&49152) == 49152 ) + else if ((j&49152) == 49152) { j &= (MAXSPRITES-1); checkhitsprite(i,j); @@ -3654,7 +3654,7 @@ void moveactors(void) } s->xvel --; if (s->xvel < 0) s->xvel = 0; - if ( s->picnum == STRIPEBALL ) + if (s->picnum == STRIPEBALL) { s->cstat = 257; s->cstat |= 4&s->xvel; @@ -3665,13 +3665,13 @@ void moveactors(void) { p = findplayer(s,&x); - if ( x < 1596) + if (x < 1596) { // if(s->pal == 12) { j = getincangle(ps[p].ang,getangle(s->x-ps[p].posx,s->y-ps[p].posy)); - if ( j > -64 && j < 64 && (sync[p].bits&(1<<29)) ) + if (j > -64 && j < 64 && (sync[p].bits&(1<<29))) if (ps[p].toggle_key_flag == 1) { a = headspritestat[1]; @@ -3680,7 +3680,7 @@ void moveactors(void) if (sprite[a].picnum == QUEBALL || sprite[a].picnum == STRIPEBALL) { j = getincangle(ps[p].ang,getangle(sprite[a].x-ps[p].posx,sprite[a].y-ps[p].posy)); - if ( j > -64 && j < 64 ) + if (j > -64 && j < 64) { findplayer(&sprite[a],&l); if (x > l) break; @@ -3699,7 +3699,7 @@ void moveactors(void) } } } - if ( x < 512 && s->sectnum == ps[p].cursectnum ) + if (x < 512 && s->sectnum == ps[p].cursectnum) { s->ang = getangle(s->x-ps[p].posx,s->y-ps[p].posy); s->xvel = 48; @@ -3759,12 +3759,12 @@ void moveactors(void) s->shade += (sector[s->sectnum].ceilingshade-s->shade)>>1; else s->shade += (sector[s->sectnum].floorshade-s->shade)>>1; - if ( s->z < sector[sect].ceilingz+(32<<8) ) + if (s->z < sector[sect].ceilingz+(32<<8)) s->z = sector[sect].ceilingz+(32<<8); - if ( ud.multimode < 2 ) + if (ud.multimode < 2) { - if ( actor_tog == 1) + if (actor_tog == 1) { s->cstat = (short)32768; goto BOLT; @@ -3773,7 +3773,7 @@ void moveactors(void) } IFHIT { - if ( s->extra < 0 && t[0] != -1 ) + if (s->extra < 0 && t[0] != -1) { t[0] = -1; s->extra = 0; @@ -3786,7 +3786,7 @@ void moveactors(void) { s->z += 1024; t[2]++; - if ( (t[2]&3) == 0) spawn(i,EXPLOSION2); + if ((t[2]&3) == 0) spawn(i,EXPLOSION2); getglobalz(i); s->ang += 96; s->xvel = 128; @@ -3804,7 +3804,7 @@ void moveactors(void) } else { - if ( s->z > hittype[i].floorz-(48<<8) ) + if (s->z > hittype[i].floorz-(48<<8)) s->z = hittype[i].floorz-(48<<8); } @@ -3813,10 +3813,10 @@ void moveactors(void) // 3 = findplayerz, 4 = shoot - if ( t[0] >= 4 ) + if (t[0] >= 4) { t[2]++; - if ( (t[2]&15) == 0 ) + if ((t[2]&15) == 0) { a = s->ang; s->ang = hittype[i].tempang; @@ -3824,7 +3824,7 @@ void moveactors(void) shoot(i,FIRELASER); s->ang = a; } - if ( t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, ps[p].posx,ps[p].posy,ps[p].posz,ps[p].cursectnum ) ) + if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, ps[p].posx,ps[p].posy,ps[p].posz,ps[p].cursectnum)) { t[0] = 0; t[2] = 0; @@ -3841,18 +3841,18 @@ void moveactors(void) if (t[0] == 2) { l = ps[p].posz-s->z; - if ( klabs(l) < (48<<8) ) t[0] = 3; + if (klabs(l) < (48<<8)) t[0] = 3; else s->z += ksgn(ps[p].posz-s->z)<<10; } else { t[2]++; - if ( t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, ps[p].posx,ps[p].posy,ps[p].posz,ps[p].cursectnum ) ) + if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, ps[p].posx,ps[p].posy,ps[p].posz,ps[p].cursectnum)) { t[0] = 1; t[2] = 0; } - else if ( (t[2]&15) == 0 ) + else if ((t[2]&15) == 0) { spritesound(RECO_ATTACK,i); shoot(i,FIRELASER); @@ -3861,7 +3861,7 @@ void moveactors(void) s->ang += getincangle(s->ang,getangle(ps[p].posx-s->x,ps[p].posy-s->y))>>2; } - if ( t[0] != 2 && t[0] != 3 ) + if (t[0] != 2 && t[0] != 3) { l = ldist(&sprite[j],s); if (l <= 1524) @@ -3875,11 +3875,11 @@ void moveactors(void) { l = dist(&sprite[j],s); - if ( l <= 1524 ) { if (t[0] == 1) t[0] = 0; else t[0] = 5; } + if (l <= 1524) { if (t[0] == 1) t[0] = 0; else t[0] = 5; } else { // Control speed here - if (l > 1524) { if ( s->xvel < 256 ) s->xvel += 32; } + if (l > 1524) { if (s->xvel < 256) s->xvel += 32; } else { if (s->xvel > 0) s->xvel -= 16; @@ -3889,7 +3889,7 @@ void moveactors(void) if (t[0] < 2) t[2]++; - if ( x < 6144 && t[0] < 2 && t[2] > (26*4) ) + if (x < 6144 && t[0] < 2 && t[2] > (26*4)) { t[0] = 2+(TRAND&2); t[2] = 0; @@ -3956,9 +3956,9 @@ void moveactors(void) // case GREENSLIME+7: // #ifndef VOLUMEONE - if ( ud.multimode < 2 ) + if (ud.multimode < 2) { - if ( actor_tog == 1) + if (actor_tog == 1) { s->cstat = (short)32768; goto BOLT; @@ -3977,7 +3977,7 @@ void moveactors(void) if (x > 20480) { hittype[i].timetosleep++; - if ( hittype[i].timetosleep > SLEEPTIME ) + if (hittype[i].timetosleep > SLEEPTIME) { hittype[i].timetosleep = 0; changespritestat(i,2); @@ -4013,7 +4013,7 @@ void moveactors(void) else if (x < 1024 && ps[p].quick_kick == 0) { j = getincangle(ps[p].ang,getangle(SX-ps[p].posx,SY-ps[p].posy)); - if ( j > -128 && j < 128 ) + if (j > -128 && j < 128) ps[p].quick_kick = 14; } @@ -4026,7 +4026,7 @@ void moveactors(void) if (t[0] == -4) //On the player { - if ( sprite[ps[p].i].extra < 1 ) + if (sprite[ps[p].i].extra < 1) { t[0] = 0; goto BOLT; @@ -4036,8 +4036,8 @@ void moveactors(void) s->ang = ps[p].ang; - if ( ( (sync[p].bits&4) || (ps[p].quick_kick > 0) ) && sprite[ps[p].i].extra > 0 ) - if ( ps[p].quick_kick > 0 || ( ps[p].curr_weapon != HANDREMOTE_WEAPON && ps[p].curr_weapon != HANDBOMB_WEAPON && ps[p].curr_weapon != TRIPBOMB_WEAPON && ps[p].ammo_amount[ps[p].curr_weapon] >= 0) ) + if (((sync[p].bits&4) || (ps[p].quick_kick > 0)) && sprite[ps[p].i].extra > 0) + if (ps[p].quick_kick > 0 || (ps[p].curr_weapon != HANDREMOTE_WEAPON && ps[p].curr_weapon != HANDBOMB_WEAPON && ps[p].curr_weapon != TRIPBOMB_WEAPON && ps[p].ammo_amount[ps[p].curr_weapon] >= 0)) { for (x=0;x<8;x++) { @@ -4047,7 +4047,7 @@ void moveactors(void) spritesound(SLIM_DYING,i); spritesound(SQUISHED,i); - if ( (TRAND&255) < 32 ) + if ((TRAND&255) < 32) { j = spawn(i,BLOODPOOL); sprite[j].pal = 0; @@ -4063,10 +4063,10 @@ void moveactors(void) s->z += (100-ps[p].horiz)<<4; - if ( t[2] > 512) + if (t[2] > 512) t[2] -= 128; - if ( t[2] < 348) + if (t[2] < 348) t[2] += 128; if (ps[p].newowner >= 0) @@ -4094,7 +4094,7 @@ void moveactors(void) s->picnum = GREENSLIME+frames[t[3]]; - if ( t[3] == 5 ) + if (t[3] == 5) { sprite[ps[p].i].extra += -(5+(TRAND&3)); spritesound(SLIM_ATTACK,i); @@ -4146,7 +4146,7 @@ void moveactors(void) goto BOLT; } - if ( (TRAND&255) < 32 ) + if ((TRAND&255) < 32) { j = spawn(i,BLOODPOOL); sprite[j].pal = 0; @@ -4231,7 +4231,7 @@ void moveactors(void) case LIZMAN__STATIC: case PIGCOP__STATIC: case NEWBEAST__STATIC: - if ( ldist(s,&sprite[j]) < 768 && (klabs(s->z-sprite[j].z)<8192) ) //Gulp them + if (ldist(s,&sprite[j]) < 768 && (klabs(s->z-sprite[j].z)<8192)) //Gulp them { t[5] = j; t[0] = -2; @@ -4250,7 +4250,7 @@ void moveactors(void) { s->picnum = GREENSLIME; - if ( (TRAND&511) == 0 ) + if ((TRAND&511) == 0) spritesound(SLIM_ROAM,i); if (t[0]==2) @@ -4258,7 +4258,7 @@ void moveactors(void) s->zvel = 0; s->cstat &= (65535-8); - if ( (sector[sect].ceilingstat&1) || (hittype[i].ceilingz+6144) < s->z) + if ((sector[sect].ceilingstat&1) || (hittype[i].ceilingz+6144) < s->z) { s->z += 2048; t[0] = 3; @@ -4271,7 +4271,7 @@ void moveactors(void) makeitfall(i); } - if ( everyothertime&1 ) ssp(i,CLIPMASK0); + if (everyothertime&1) ssp(i,CLIPMASK0); if (s->xvel > 96) { @@ -4293,7 +4293,7 @@ void moveactors(void) if (rnd(4) && (sector[sect].ceilingstat&1) == 0 && klabs(hittype[i].floorz-hittype[i].ceilingz) - < (192<<8) ) + < (192<<8)) { s->zvel = 0; t[0]++; @@ -4350,7 +4350,7 @@ void moveactors(void) case HEAVYHBOMB__STATIC: - if ( (s->cstat&32768) ) + if ((s->cstat&32768)) { t[2]--; if (t[2] <= 0) @@ -4364,10 +4364,10 @@ void moveactors(void) p = findplayer(s,&x); - if ( x < 1220 ) s->cstat &= ~257; + if (x < 1220) s->cstat &= ~257; else s->cstat |= 257; - if (t[3] == 0 ) + if (t[3] == 0) { j = ifhitbyweapon(i); if (j >= 0) @@ -4380,20 +4380,20 @@ void moveactors(void) } } - if ( s->picnum != BOUNCEMINE ) + if (s->picnum != BOUNCEMINE) { makeitfall(i); - if ( sector[sect].lotag != 1 && s->z >= hittype[i].floorz-(FOURSLEIGHT) && s->yvel < 3 ) + if (sector[sect].lotag != 1 && s->z >= hittype[i].floorz-(FOURSLEIGHT) && s->yvel < 3) { - if ( s->yvel > 0 || (s->yvel == 0 && hittype[i].floorz == sector[sect].floorz )) + if (s->yvel > 0 || (s->yvel == 0 && hittype[i].floorz == sector[sect].floorz)) spritesound(PIPEBOMB_BOUNCE,i); s->zvel = -((4-s->yvel)<<8); if (sector[s->sectnum].lotag== 2) s->zvel >>= 2; s->yvel++; } - if ( s->z < hittype[i].ceilingz ) // && sector[sect].lotag != 2 ) + if (s->z < hittype[i].ceilingz) // && sector[sect].lotag != 2 ) { s->z = hittype[i].ceilingz+(3<<8); s->zvel = 0; @@ -4416,7 +4416,7 @@ void moveactors(void) } else t[5] = 0; - if (t[3] == 0 && ( s->picnum == BOUNCEMINE || s->picnum == MORTER ) && (j || x < 844) ) + if (t[3] == 0 && (s->picnum == BOUNCEMINE || s->picnum == MORTER) && (j || x < 844)) { t[3] = 1; t[4] = 0; @@ -4440,7 +4440,7 @@ void moveactors(void) if (s->xvel&8) s->cstat ^= 4; } - if ( (j&49152) == 32768 ) + if ((j&49152) == 32768) { j &= (MAXWALLS-1); @@ -4461,7 +4461,7 @@ DETONATEB: // if(lPipeBombControl & PIPEBOMB_TIMER) // { - if ( s->picnum == HEAVYHBOMB && hittype[i].temp_data[6] == 1) + if (s->picnum == HEAVYHBOMB && hittype[i].temp_data[6] == 1) { /* if(s->extra >= 1) { @@ -4485,7 +4485,7 @@ DETONATEB: } // } - if (( l >= 0 && ps[l].hbomb_on == 0 && hittype[i].temp_data[6] == 2) || t[3] == 1) + if ((l >= 0 && ps[l].hbomb_on == 0 && hittype[i].temp_data[6] == 2) || t[3] == 1) hittype[i].temp_data[6] = 3; if (hittype[i].temp_data[6] == 3) @@ -4507,9 +4507,9 @@ DETONATEB: m = bouncemineblastradius;break; } - hitradius( i, m,x>>2,x>>1,x-(x>>2),x); + hitradius(i, m,x>>2,x>>1,x-(x>>2),x); spawn(i,EXPLOSION2); - if ( s->zvel == 0 ) + if (s->zvel == 0) spawn(i,EXPLOSION2BOT); spritesound(PIPEBOMB_EXPLODE,i); for (x=0;x<8;x++) @@ -4539,8 +4539,8 @@ DETONATEB: } } else if (s->picnum == HEAVYHBOMB && x < 788 && t[0] > 7 && s->xvel == 0) - if ( cansee(s->x,s->y,s->z-(8<<8),s->sectnum,ps[p].posx,ps[p].posy,ps[p].posz,ps[p].cursectnum) ) - if (ps[p].ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON] ) + if (cansee(s->x,s->y,s->z-(8<<8),s->sectnum,ps[p].posx,ps[p].posy,ps[p].posz,ps[p].cursectnum)) + if (ps[p].ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) { if ((gametype_flags[ud.coop] & GAMETYPE_FLAG_WEAPSTAY) && s->owner == i) { @@ -4555,15 +4555,15 @@ DETONATEB: addammo(HANDBOMB_WEAPON,&ps[p],1); spritesound(DUKE_GET,ps[p].i); - if ( ps[p].gotweapon[HANDBOMB_WEAPON] == 0 || s->owner == ps[p].i ) + if (ps[p].gotweapon[HANDBOMB_WEAPON] == 0 || s->owner == ps[p].i) { /* addweapon(&ps[p],HANDBOMB_WEAPON); */ if (!(ps[p].weaponswitch & 1) && *aplWeaponWorksLike[ps[p].curr_weapon] != HANDREMOTE_WEAPON) addweaponnoswitch(&ps[p],HANDBOMB_WEAPON); - else addweapon( &ps[p],HANDBOMB_WEAPON); + else addweapon(&ps[p],HANDBOMB_WEAPON); } - if ( sprite[s->owner].picnum != APLAYER ) + if (sprite[s->owner].picnum != APLAYER) { ps[p].pals[0] = 0; ps[p].pals[1] = 32; @@ -4571,7 +4571,7 @@ DETONATEB: ps[p].pals_time = 32; } - if ( s->owner != i || ud.respawn_items == 0 ) + if (s->owner != i || ud.respawn_items == 0) { if (s->owner == i && (gametype_flags[ud.coop] & GAMETYPE_FLAG_WEAPSTAY)) goto BOLT; @@ -4595,7 +4595,7 @@ DETONATEB: case REACTOR__STATIC: case REACTOR2__STATIC: - if ( t[4] == 1 ) + if (t[4] == 1) { j = headspritesect[sect]; while (j >= 0) @@ -4634,11 +4634,11 @@ DETONATEB: p = findplayer(s,&x); t[2]++; - if ( t[2] == 4 ) t[2]=0; + if (t[2] == 4) t[2]=0; - if ( x < 4096 ) + if (x < 4096) { - if ( (TRAND&255) < 16 ) + if ((TRAND&255) < 16) { if (!isspritemakingsound(ps[p].i, DUKE_LONGTERM_PAIN)) spritesound(DUKE_LONGTERM_PAIN,ps[p].i); @@ -4652,27 +4652,27 @@ DETONATEB: ps[p].pals[2] = 0; } t[0] += 128; - if ( t[3] == 0 ) + if (t[3] == 0) t[3] = 1; } else t[3] = 0; - if ( t[1] ) + if (t[1]) { t[1]++; t[4] = s->z; s->z = sector[sect].floorz-(TRAND%(sector[sect].floorz-sector[sect].ceilingz)); - switch ( t[1] ) + switch (t[1]) { case 3: //Turn on all of those flashing sectoreffector. - hitradius( i, 4096, - impact_damage<<2, - impact_damage<<2, - impact_damage<<2, - impact_damage<<2 ); + hitradius(i, 4096, + impact_damage<<2, + impact_damage<<2, + impact_damage<<2, + impact_damage<<2); /* j = headspritestat[3]; while(j>=0) @@ -4739,7 +4739,7 @@ DETONATEB: case CAMERA1__STATIC: - if ( t[0] == 0 ) + if (t[0] == 0) { t[1]+=8; if (camerashitable) @@ -4759,7 +4759,7 @@ DETONATEB: s->ang+=8; else if (t[1]<(s->hitag*3)) s->ang-=8; - else if (t[1] < (s->hitag<<2) ) + else if (t[1] < (s->hitag<<2)) s->ang+=8; else { @@ -4773,9 +4773,9 @@ DETONATEB: // #ifndef VOLOMEONE - if ( ud.multimode < 2 && badguy(s) ) + if (ud.multimode < 2 && badguy(s)) { - if ( actor_tog == 1) + if (actor_tog == 1) { s->cstat = (short)32768; goto BOLT; @@ -4811,7 +4811,7 @@ void moveexplosions(void) // STATNUM 5 s = &sprite[i]; sect = s->sectnum; - if ( sect < 0 || s->xrepeat == 0 ) KILLIT(i); + if (sect < 0 || s->xrepeat == 0) KILLIT(i); hittype[i].bposx = s->x; hittype[i].bposy = s->y; @@ -4826,7 +4826,7 @@ void moveexplosions(void) // STATNUM 5 if (s->picnum ==INNERJAW+1) { switchpicnum--; } - if ( (s->picnum == MONEY+1) || (s->picnum == MAIL+1) || (s->picnum == PAPER+1) ) + if ((s->picnum == MONEY+1) || (s->picnum == MAIL+1) || (s->picnum == PAPER+1)) hittype[i].floorz = s->z = getflorzofslope(s->sectnum,s->x,s->y); else switch (dynamictostatic[switchpicnum]) { @@ -4837,7 +4837,7 @@ void moveexplosions(void) // STATNUM 5 case NEON5__STATIC: case NEON6__STATIC: - if ( (global_random/(s->lotag+1)&31) > 4) s->shade = -127; + if ((global_random/(s->lotag+1)&31) > 4) s->shade = -127; else s->shade = 127; goto BOLT; @@ -4846,10 +4846,10 @@ void moveexplosions(void) // STATNUM 5 case BLOODSPLAT3__STATIC: case BLOODSPLAT4__STATIC: - if ( t[0] == 7*26 ) goto BOLT; + if (t[0] == 7*26) goto BOLT; s->z += 16+(TRAND&15); t[0]++; - if ( (t[0]%9) == 0 ) s->yrepeat++; + if ((t[0]%9) == 0) s->yrepeat++; goto BOLT; case NUKEBUTTON__STATIC: @@ -4866,7 +4866,7 @@ void moveexplosions(void) // STATNUM 5 s->picnum = NUKEBUTTON+2; ps[sprite[s->owner].yvel].fist_incs = 1; } - if ( ps[sprite[s->owner].yvel].fist_incs == 26 ) + if (ps[sprite[s->owner].yvel].fist_incs == 26) s->picnum = NUKEBUTTON+3; } goto BOLT; @@ -4915,7 +4915,7 @@ void moveexplosions(void) // STATNUM 5 case WATERSPLASH2__STATIC: t[0]++; - if (t[0] == 1 ) + if (t[0] == 1) { if (sector[sect].lotag != 1 && sector[sect].lotag != 2) KILLIT(i); @@ -4943,13 +4943,13 @@ void moveexplosions(void) // STATNUM 5 { t[0]++; - if ( t[0] > 7 ) + if (t[0] > 7) { KILLIT(i); } - else if ( t[0] > 4 ) + else if (t[0] > 4) s->cstat |= 512+2; - else if ( t[0] > 2 ) + else if (t[0] > 2) s->cstat |= 2; s->xoffset = sprite[s->owner].xoffset; s->yoffset = sprite[s->owner].yoffset; @@ -4982,7 +4982,7 @@ void moveexplosions(void) // STATNUM 5 s->xvel = (TRAND&7)+(sintable[T1&2047]>>9); T1 += (TRAND&63); - if ( (T1&2047) > 512 && (T1&2047) < 1596) + if ((T1&2047) > 512 && (T1&2047) < 1596) { if (sector[sect].lotag == 2) { @@ -4996,13 +4996,13 @@ void moveexplosions(void) // STATNUM 5 ssp(i,CLIPMASK0); - if ( (TRAND&3) == 0 ) + if ((TRAND&3) == 0) setsprite(i,s->x,s->y,s->z); if (s->sectnum == -1) KILLIT(i); l = getflorzofslope(s->sectnum,s->x,s->y); - if ( s->z > l ) + if (s->z > l) { s->z = l; @@ -5043,7 +5043,7 @@ void moveexplosions(void) // STATNUM 5 if (s->xvel > 0) s->xvel--; else s->xvel = 0; - if ( t[5] < 30*10 ) + if (t[5] < 30*10) t[5]++; else { KILLIT(i); } @@ -5058,13 +5058,13 @@ void moveexplosions(void) // STATNUM 5 x = getceilzofslope(sect,s->x,s->y); if (x == l || sect < 0 || sect >= MAXSECTORS) KILLIT(i); - if ( s->z < l-(2<<8) ) + if (s->z < l-(2<<8)) { if (t[1] < 2) t[1]++; else if (sector[sect].lotag != 2) { t[1] = 0; - if ( s->picnum == DUKELEG || s->picnum == DUKETORSO || s->picnum == DUKEGUN ) + if (s->picnum == DUKELEG || s->picnum == DUKETORSO || s->picnum == DUKEGUN) { if (t[0] > 6) t[0] = 0; else t[0]++; @@ -5097,8 +5097,8 @@ void moveexplosions(void) // STATNUM 5 { if (t[2] == 0) { - if ( s->sectnum == -1) { KILLIT(i); } - if ( (sector[s->sectnum].floorstat&2) ) { KILLIT(i); } + if (s->sectnum == -1) { KILLIT(i); } + if ((sector[s->sectnum].floorstat&2)) { KILLIT(i); } t[2]++; } l = getflorzofslope(s->sectnum,s->x,s->y); @@ -5109,7 +5109,7 @@ void moveexplosions(void) // STATNUM 5 if (s->picnum == JIBS6) { t[1]++; - if ( (t[1]&3) == 0 && t[0] < 7) + if ((t[1]&3) == 0 && t[0] < 7) t[0]++; if (t[1] > 20) KILLIT(i); } @@ -5157,7 +5157,7 @@ void moveexplosions(void) // STATNUM 5 if (x < 844 && s->xrepeat > 6 && s->yrepeat > 6) { - if ( s->pal == 0 && (TRAND&255) < 16 && s->picnum != PUKE) + if (s->pal == 0 && (TRAND&255) < 16 && s->picnum != PUKE) { if (ps[p].boot_amount > 0) ps[p].boot_amount--; @@ -5214,7 +5214,7 @@ void moveexplosions(void) // STATNUM 5 ssp(i,CLIPMASK0); - if (sect < 0 || ( sector[sect].floorz + 256 ) < s->z ) KILLIT(i); + if (sect < 0 || (sector[sect].floorz + 256) < s->z) KILLIT(i); if (sector[sect].lotag == 2) { @@ -5257,18 +5257,18 @@ void moveexplosions(void) // STATNUM 5 if (s->zvel > 4096) s->zvel = 4096; if (sect < 0) KILLIT(i); - if ( s->z == hittype[i].floorz-(FOURSLEIGHT) && t[0] < 3) + if (s->z == hittype[i].floorz-(FOURSLEIGHT) && t[0] < 3) { s->zvel = -((3-t[0])<<8)-(TRAND&511); if (sector[sect].lotag == 2) s->zvel >>= 1; s->xrepeat >>= 1; s->yrepeat >>= 1; - if ( rnd(96) ) + if (rnd(96)) setsprite(i,s->x,s->y,s->z); t[0]++;//Number of bounces } - else if ( t[0] == 3 ) KILLIT(i); + else if (t[0] == 3) KILLIT(i); if (s->xvel > 0) { @@ -5294,7 +5294,7 @@ void moveexplosions(void) // STATNUM 5 sect = s->sectnum; } - if ( s->z < sector[sect].floorz-(2<<8) ) + if (s->z < sector[sect].floorz-(2<<8)) { if (t[1] < 1) t[1]++; else @@ -5370,7 +5370,7 @@ void moveeffectors(void) //STATNUM 3 j = s->owner; - if ( sprite[j].lotag == (short) 65535 ) + if (sprite[j].lotag == (short) 65535) KILLIT(i); q = sc->extra>>3; @@ -5380,7 +5380,7 @@ void moveeffectors(void) //STATNUM 3 { q >>= 2; - if ( sprite[i].extra == 1 ) + if (sprite[i].extra == 1) { if (hittype[i].tempang < 256) { @@ -5392,19 +5392,19 @@ void moveeffectors(void) //STATNUM 3 } else hittype[i].tempang = 256; - if ( sc->floorz > s->z ) //z's are touching + if (sc->floorz > s->z) //z's are touching { sc->floorz -= 512; zchange = -512; - if ( sc->floorz < s->z ) + if (sc->floorz < s->z) sc->floorz = s->z; } - else if ( sc->floorz < s->z ) //z's are touching + else if (sc->floorz < s->z) //z's are touching { sc->floorz += 512; zchange = 512; - if ( sc->floorz > s->z ) + if (sc->floorz > s->z) sc->floorz = s->z; } } @@ -5415,24 +5415,24 @@ void moveeffectors(void) //STATNUM 3 hittype[i].tempang -= 4; if (hittype[i].tempang <= 0) callsound(s->sectnum,i); - if ( s->clipdist ) l = -1; + if (s->clipdist) l = -1; else l = 1; } else hittype[i].tempang = 0; - if ( sc->floorz > T4 ) //z's are touching + if (sc->floorz > T4) //z's are touching { sc->floorz -= 512; zchange = -512; - if ( sc->floorz < T4 ) + if (sc->floorz < T4) sc->floorz = T4; } - else if ( sc->floorz < T4 ) //z's are touching + else if (sc->floorz < T4) //z's are touching { sc->floorz += 512; zchange = 512; - if ( sc->floorz > T4 ) + if (sc->floorz > T4) sc->floorz = T4; } } @@ -5442,13 +5442,13 @@ void moveeffectors(void) //STATNUM 3 } else { - if ( hittype[j].temp_data[0] == 0 ) break; - if ( hittype[j].temp_data[0] == 2 ) KILLIT(i); + if (hittype[j].temp_data[0] == 0) break; + if (hittype[j].temp_data[0] == 2) KILLIT(i); - if ( sprite[j].ang > 1024 ) + if (sprite[j].ang > 1024) l = -1; else l = 1; - if ( t[3] == 0 ) + if (t[3] == 0) t[3] = ldist(s,&sprite[j]); s->xvel = t[3]; s->x = sprite[j].x; @@ -5457,11 +5457,11 @@ void moveeffectors(void) //STATNUM 3 t[2] += (l*q); } - if ( l && (sc->floorstat&64) ) + if (l && (sc->floorstat&64)) { for (p=connecthead;p>=0;p=connectpoint2[p]) { - if ( ps[p].cursectnum == s->sectnum && ps[p].on_ground == 1) + if (ps[p].cursectnum == s->sectnum && ps[p].on_ground == 1) { ps[p].ang += (l*q); @@ -5469,9 +5469,9 @@ void moveeffectors(void) //STATNUM 3 ps[p].posz += zchange; - rotatepoint( sprite[j].x,sprite[j].y, - ps[p].posx,ps[p].posy,(q*l), - &m,&x); + rotatepoint(sprite[j].x,sprite[j].y, + ps[p].posx,ps[p].posy,(q*l), + &m,&x); ps[p].bobposx += m-ps[p].posx; ps[p].bobposy += x-ps[p].posy; @@ -5491,7 +5491,7 @@ void moveeffectors(void) //STATNUM 3 while (p >= 0) { if (sprite[p].statnum != 3 && sprite[p].statnum != 4) - if ( sprite[p].picnum != LASERLINE ) + if (sprite[p].picnum != LASERLINE) { if (sprite[p].picnum == APLAYER && sprite[p].owner >= 0) { @@ -5526,7 +5526,7 @@ void moveeffectors(void) //STATNUM 3 j = headspritestat[3]; while (j >= 0) { - if ( sprite[j].lotag == 19 && sprite[j].hitag == sh ) + if (sprite[j].lotag == 19 && sprite[j].hitag == sh) { t[0] = 0; break; @@ -5542,13 +5542,13 @@ void moveeffectors(void) //STATNUM 3 if (t[4] > 0) { t[4]--; - if ( t[4] >= (k-(k>>3)) ) + if (t[4] >= (k-(k>>3))) s->xvel -= (k>>5); - if ( t[4] > ((k>>1)-1) && t[4] < (k-(k>>3)) ) + if (t[4] > ((k>>1)-1) && t[4] < (k-(k>>3))) s->xvel = 0; - if ( t[4] < (k>>1) ) + if (t[4] < (k>>1)) s->xvel += (k>>5); - if ( t[4] < ((k>>1)-(k>>3)) ) + if (t[4] < ((k>>1)-(k>>3))) { t[4] = 0; s->xvel = k; @@ -5557,16 +5557,16 @@ void moveeffectors(void) //STATNUM 3 else s->xvel = k; j = headspritestat[3]; - while ( j >= 0) + while (j >= 0) { - if ( (sprite[j].lotag == 14) && (sh == sprite[j].hitag) && (hittype[j].temp_data[0] == t[0]) ) + if ((sprite[j].lotag == 14) && (sh == sprite[j].hitag) && (hittype[j].temp_data[0] == t[0])) { sprite[j].xvel = s->xvel; // if( t[4] == 1 ) { if (hittype[j].temp_data[5] == 0) hittype[j].temp_data[5] = dist(&sprite[j],s); - x = ksgn( dist(&sprite[j],s)-hittype[j].temp_data[5] ); + x = ksgn(dist(&sprite[j],s)-hittype[j].temp_data[5]); if (sprite[j].extra) x = -x; s->xvel += x; @@ -5590,7 +5590,7 @@ void moveeffectors(void) //STATNUM 3 j = ldist(&sprite[s->owner],s); - if ( j < 1024L ) + if (j < 1024L) { if (st==6) if (sprite[s->owner].hitag&1) @@ -5612,14 +5612,14 @@ void moveeffectors(void) //STATNUM 3 t[2] += q; s->ang += q; - if (s->xvel == sc->extra ) + if (s->xvel == sc->extra) { - if ( (sc->floorstat&1) == 0 && (sc->ceilingstat&1) == 0 ) + if ((sc->floorstat&1) == 0 && (sc->ceilingstat&1) == 0) { - if ( !issoundplaying(i,hittype[i].lastvx) ) + if (!issoundplaying(i,hittype[i].lastvx)) spritesound(hittype[i].lastvx,i); } - else if ( ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat&1) && rnd(8) ) + else if (ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat&1) && rnd(8)) { p = findplayer(s,&x); if (x < 20480) @@ -5632,10 +5632,10 @@ void moveeffectors(void) //STATNUM 3 } } - if (s->xvel <= 64 && (sc->floorstat&1) == 0 && (sc->ceilingstat&1) == 0 ) + if (s->xvel <= 64 && (sc->floorstat&1) == 0 && (sc->ceilingstat&1) == 0) stopspritesound(hittype[i].lastvx,i); - if ( (sc->floorz-sc->ceilingz) < (108<<8) ) + if ((sc->floorz-sc->ceilingz) < (108<<8)) { if (ud.clipping == 0 && s->xvel >= 192) for (p=connecthead;p>=0;p=connectpoint2[p]) @@ -5643,7 +5643,7 @@ void moveeffectors(void) //STATNUM 3 { k = ps[p].cursectnum; updatesector(ps[p].posx,ps[p].posy,&k); - if ( ( k == -1 && ud.clipping == 0 ) || ( k == s->sectnum && ps[p].cursectnum != s->sectnum ) ) + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && ps[p].cursectnum != s->sectnum)) { ps[p].posx = s->x; ps[p].posy = s->y; @@ -5684,7 +5684,7 @@ void moveeffectors(void) //STATNUM 3 ps[p].oposx = ps[p].posx; ps[p].oposy = ps[p].posy; } - if ( sprite[ps[p].i].extra <= 0 ) + if (sprite[ps[p].i].extra <= 0) { sprite[ps[p].i].x = ps[p].posx; sprite[ps[p].i].y = ps[p].posy; @@ -5694,7 +5694,7 @@ void moveeffectors(void) //STATNUM 3 j = headspritesect[s->sectnum]; while (j >= 0) { - if (sprite[j].statnum != 10 && sector[sprite[j].sectnum].lotag != 2 && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS ) + if (sprite[j].statnum != 10 && sector[sprite[j].sectnum].lotag != 2 && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS) { rotatepoint(s->x,s->y, sprite[j].x,sprite[j].y,q, @@ -5717,7 +5717,7 @@ void moveeffectors(void) //STATNUM 3 ms(i); setsprite(i,s->x,s->y,s->z); - if ( (sc->floorz-sc->ceilingz) < (108<<8) ) + if ((sc->floorz-sc->ceilingz) < (108<<8)) { if (ud.clipping == 0 && s->xvel >= 192) for (p=connecthead;p>=0;p=connectpoint2[p]) @@ -5725,7 +5725,7 @@ void moveeffectors(void) //STATNUM 3 { k = ps[p].cursectnum; updatesector(ps[p].posx,ps[p].posy,&k); - if ( ( k == -1 && ud.clipping == 0 ) || ( k == s->sectnum && ps[p].cursectnum != s->sectnum ) ) + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && ps[p].cursectnum != s->sectnum)) { ps[p].oposx = ps[p].posx = s->x; ps[p].oposy = ps[p].posy = s->y; @@ -5740,11 +5740,11 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { l = nextspritesect[j]; - if (sprite[j].statnum == 1 && badguy(&sprite[j]) && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS ) + if (sprite[j].statnum == 1 && badguy(&sprite[j]) && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS) { k = sprite[j].sectnum; updatesector(sprite[j].x,sprite[j].y,&k); - if ( sprite[j].extra >= 0 && k == s->sectnum ) + if (sprite[j].extra >= 0 && k == s->sectnum) { gutsdir(&sprite[j],JIBS6,72,myconnectindex); spritesound(SQUISHED,i); @@ -5769,7 +5769,7 @@ void moveeffectors(void) //STATNUM 3 if (t[4] == 1) // Starting to go { - if ( ldist( &sprite[s->owner],s ) < (2048-128) ) + if (ldist(&sprite[s->owner],s) < (2048-128)) t[4] = 2; else { @@ -5786,7 +5786,7 @@ void moveeffectors(void) //STATNUM 3 if (l <= 128) s->xvel = 0; - if ( s->xvel > 0 ) + if (s->xvel > 0) s->xvel -= 16; else { @@ -5800,7 +5800,7 @@ void moveeffectors(void) //STATNUM 3 j = headspritesect[s->sectnum]; while (j >= 0) { - if (sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS ) + if (sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS) { hittype[j].bposx = sprite[j].x; hittype[j].bposy = sprite[j].y; @@ -5817,14 +5817,14 @@ void moveeffectors(void) //STATNUM 3 l = (s->xvel*sintable[(s->ang+512)&2047])>>14; x = (s->xvel*sintable[s->ang&2047])>>14; - if ( (sc->floorz-sc->ceilingz) < (108<<8) ) + if ((sc->floorz-sc->ceilingz) < (108<<8)) if (ud.clipping == 0) for (p=connecthead;p>=0;p=connectpoint2[p]) if (sprite[ps[p].i].extra > 0) { k = ps[p].cursectnum; updatesector(ps[p].posx,ps[p].posy,&k); - if ( ( k == -1 && ud.clipping == 0 ) || ( k == s->sectnum && ps[p].cursectnum != s->sectnum ) ) + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && ps[p].cursectnum != s->sectnum)) { ps[p].posx = s->x; ps[p].posy = s->y; @@ -5837,7 +5837,7 @@ void moveeffectors(void) //STATNUM 3 for (p = connecthead;p >= 0;p = connectpoint2[p]) { - if ( sprite[ps[p].i].sectnum == s->sectnum ) + if (sprite[ps[p].i].sectnum == s->sectnum) { ps[p].posx += l; ps[p].posy += x; @@ -5852,7 +5852,7 @@ void moveeffectors(void) //STATNUM 3 ps[p].bobposy += x; } - if ( po[p].os == s->sectnum ) + if (po[p].os == s->sectnum) { po[p].ox += l; po[p].oy += x; @@ -5862,7 +5862,7 @@ void moveeffectors(void) //STATNUM 3 j = headspritesect[s->sectnum]; while (j >= 0) { - if (sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS ) + if (sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS) { if (numplayers < 2) { @@ -5885,7 +5885,7 @@ void moveeffectors(void) //STATNUM 3 ms(i); setsprite(i,s->x,s->y,s->z); - if ( (sc->floorz-sc->ceilingz) < (108<<8) ) + if ((sc->floorz-sc->ceilingz) < (108<<8)) { if (ud.clipping == 0) for (p=connecthead;p>=0;p=connectpoint2[p]) @@ -5893,7 +5893,7 @@ void moveeffectors(void) //STATNUM 3 { k = ps[p].cursectnum; updatesector(ps[p].posx,ps[p].posy,&k); - if ( ( k == -1 && ud.clipping == 0 ) || ( k == s->sectnum && ps[p].cursectnum != s->sectnum ) ) + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && ps[p].cursectnum != s->sectnum)) { ps[p].posx = s->x; ps[p].posy = s->y; @@ -5912,13 +5912,13 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { l = nextspritesect[j]; - if (sprite[j].statnum == 1 && badguy(&sprite[j]) && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS ) + if (sprite[j].statnum == 1 && badguy(&sprite[j]) && sprite[j].picnum != SECTOREFFECTOR && sprite[j].picnum != LOCATORS) { // if(sprite[j].sectnum != s->sectnum) { k = sprite[j].sectnum; updatesector(sprite[j].x,sprite[j].y,&k); - if ( sprite[j].extra >= 0 && k == s->sectnum ) + if (sprite[j].extra >= 0 && k == s->sectnum) { gutsdir(&sprite[j],JIBS6,24,myconnectindex); spritesound(SQUISHED,j); @@ -5936,9 +5936,9 @@ void moveeffectors(void) //STATNUM 3 case 2://Quakes - if (t[4] > 0 && t[0] == 0 ) + if (t[4] > 0 && t[0] == 0) { - if ( t[4] < sh ) + if (t[4] < sh) t[4]++; else t[0] = 1; } @@ -5957,15 +5957,15 @@ void moveeffectors(void) //STATNUM 3 } else { - if ( (t[0]&31) == 8 ) + if ((t[0]&31) == 8) { earthquaketime = 48; spritesound(EARTHQUAKE,ps[screenpeek].i); } - if ( klabs( sc->floorheinum-t[5] ) < 8 ) + if (klabs(sc->floorheinum-t[5]) < 8) sc->floorheinum = t[5]; - else sc->floorheinum += ( ksgn(t[5]-sc->floorheinum)<<4 ); + else sc->floorheinum += (ksgn(t[5]-sc->floorheinum)<<4); } m = (s->xvel*sintable[(s->ang+512)&2047])>>14; @@ -6004,12 +6004,12 @@ void moveeffectors(void) //STATNUM 3 case 3: - if ( t[4] == 0 ) break; + if (t[4] == 0) break; p = findplayer(s,&x); // if(t[5] > 0) { t[5]--; break; } - if ( (global_random/(sh+1)&31) < 4 && !t[2]) + if ((global_random/(sh+1)&31) < 4 && !t[2]) { // t[5] = 4+(global_random&7); sc->ceilingpal = s->owner>>8; @@ -6031,7 +6031,7 @@ void moveeffectors(void) //STATNUM 3 for (x=sc->wallnum;x > 0;x--,wal++) { - if ( wal->hitag != 1 ) + if (wal->hitag != 1) { wal->shade = t[0]; if ((wal->cstat&2) && wal->nextwall >= 0) @@ -6045,7 +6045,7 @@ void moveeffectors(void) //STATNUM 3 case 4: - if ((global_random/(sh+1)&31) < 4 ) + if ((global_random/(sh+1)&31) < 4) { t[1] = s->shade + (global_random&15);//Got really bright t[0] = s->shade + (global_random&15); @@ -6074,7 +6074,7 @@ void moveeffectors(void) //STATNUM 3 if (j) wal->pal = (s->owner&0xff); else wal->pal = s->pal; - if ( wal->hitag != 1 ) + if (wal->hitag != 1) { wal->shade = t[0]; if ((wal->cstat&2) && wal->nextwall >= 0) @@ -6190,26 +6190,26 @@ void moveeffectors(void) //STATNUM 3 if (hittype[i].temp_data[4]) { hittype[i].temp_data[4]++; - if ( hittype[i].temp_data[4] > 8 ) KILLIT(i); + if (hittype[i].temp_data[4] > 8) KILLIT(i); j = 1; } else j = getanimationgoal(&sc->ceilingz); - if ( j >= 0 ) + if (j >= 0) { short sn; - if ( (sc->lotag&0x8000) || hittype[i].temp_data[4] ) + if ((sc->lotag&0x8000) || hittype[i].temp_data[4]) x = -t[3]; else x = t[3]; - if ( st == 9 ) x = -x; + if (st == 9) x = -x; j = headspritestat[3]; while (j >= 0) { - if ( ((sprite[j].lotag) == st ) && (sprite[j].hitag) == sh ) + if (((sprite[j].lotag) == st) && (sprite[j].hitag) == sh) { sn = sprite[j].sectnum; m = sprite[j].shade; @@ -6218,7 +6218,7 @@ void moveeffectors(void) //STATNUM 3 for (l=sector[sn].wallnum;l>0;l--,wal++) { - if ( wal->hitag != 1 ) + if (wal->hitag != 1) { wal->shade+=x; @@ -6253,26 +6253,26 @@ void moveeffectors(void) //STATNUM 3 break; case 10: - if ( (sc->lotag&0xff) == 27 || ( sc->floorz > sc->ceilingz && (sc->lotag&0xff) != 23 ) || sc->lotag == (short) 32791 ) + if ((sc->lotag&0xff) == 27 || (sc->floorz > sc->ceilingz && (sc->lotag&0xff) != 23) || sc->lotag == (short) 32791) { j = 1; - if ( (sc->lotag&0xff) != 27) + if ((sc->lotag&0xff) != 27) for (p=connecthead;p>=0;p=connectpoint2[p]) - if ( sc->lotag != 30 && sc->lotag != 31 && sc->lotag != 0 ) + if (sc->lotag != 30 && sc->lotag != 31 && sc->lotag != 0) if (s->sectnum == sprite[ps[p].i].sectnum) j = 0; if (j == 1) { - if (t[0] > sh ) + if (t[0] > sh) switch (sector[s->sectnum].lotag) { case 20: case 21: case 22: case 26: - if ( getanimationgoal(§or[s->sectnum].ceilingz) >= 0 ) + if (getanimationgoal(§or[s->sectnum].ceilingz) >= 0) break; default: activatebysector(s->sectnum,i); @@ -6286,13 +6286,13 @@ void moveeffectors(void) //STATNUM 3 break; case 11: //Swingdoor - if ( t[5] > 0) + if (t[5] > 0) { t[5]--; break; } - if ( t[4] ) + if (t[4]) { short startwall,endwall; @@ -6304,7 +6304,7 @@ void moveeffectors(void) //STATNUM 3 k = headspritestat[1]; while (k >= 0) { - if ( sprite[k].extra > 0 && badguy(&sprite[k]) && clipinsidebox(sprite[k].x,sprite[k].y,j,256L) == 1 ) + if (sprite[k].extra > 0 && badguy(&sprite[k]) && clipinsidebox(sprite[k].x,sprite[k].y,j,256L) == 1) goto BOLT; k = nextspritestat[k]; } @@ -6312,7 +6312,7 @@ void moveeffectors(void) //STATNUM 3 k = headspritestat[10]; while (k >= 0) { - if ( sprite[k].owner >= 0 && clipinsidebox(sprite[k].x,sprite[k].y,j,144L) == 1 ) + if (sprite[k].owner >= 0 && clipinsidebox(sprite[k].x,sprite[k].y,j,144L) == 1) { t[5] = 8; // Delay k = (SP>>3)*t[3]; @@ -6343,7 +6343,7 @@ void moveeffectors(void) //STATNUM 3 } break; case 12: - if ( t[0] == 3 || t[3] == 1 ) //Lights going off + if (t[0] == 3 || t[3] == 1) //Lights going off { sc->floorpal = 0; sc->ceilingpal = 0; @@ -6375,9 +6375,9 @@ void moveeffectors(void) //STATNUM 3 if (t[3] == 1) KILLIT(i); } - if ( t[0] == 1 ) //Lights flickering on + if (t[0] == 1) //Lights flickering on { - if ( sc->floorshade > s->shade ) + if (sc->floorshade > s->shade) { sc->floorpal = s->pal; sc->ceilingpal = s->pal; @@ -6411,36 +6411,36 @@ void moveeffectors(void) //STATNUM 3 case 13: - if ( t[2] ) + if (t[2]) { j = (SP<<5)|1; - if ( s->ang == 512 ) + if (s->ang == 512) { - if ( s->owner ) + if (s->owner) { - if ( klabs(t[0]-sc->ceilingz) >= j ) + if (klabs(t[0]-sc->ceilingz) >= j) sc->ceilingz += ksgn(t[0]-sc->ceilingz)*j; else sc->ceilingz = t[0]; } else { - if ( klabs(t[1]-sc->floorz) >= j ) + if (klabs(t[1]-sc->floorz) >= j) sc->floorz += ksgn(t[1]-sc->floorz)*j; else sc->floorz = t[1]; } } else { - if ( klabs(t[1]-sc->floorz) >= j ) + if (klabs(t[1]-sc->floorz) >= j) sc->floorz += ksgn(t[1]-sc->floorz)*j; else sc->floorz = t[1]; - if ( klabs(t[0]-sc->ceilingz) >= j ) + if (klabs(t[0]-sc->ceilingz) >= j) sc->ceilingz += ksgn(t[0]-sc->ceilingz)*j; sc->ceilingz = t[0]; } - if ( t[3] == 1 ) + if (t[3] == 1) { //Change the shades @@ -6470,7 +6470,7 @@ void moveeffectors(void) //STATNUM 3 } - if ( t[2] == 4 && s->ang != 512) + if (t[2] == 4 && s->ang != 512) for (x=0;x<7;x++) RANDOMSCRAP; break; @@ -6483,7 +6483,7 @@ void moveeffectors(void) //STATNUM 3 if (t[4] == 1) //Opening { - if ( t[3] >= (SP>>3) ) + if (t[3] >= (SP>>3)) { t[4] = 0; //Turn off the sliders callsound(s->sectnum,i); @@ -6512,7 +6512,7 @@ void moveeffectors(void) //STATNUM 3 t[2]+=32; if (sc->floorzceilingz) s->shade=0; - else if ( sc->ceilingz < t[3] ) + else if (sc->ceilingz < t[3]) { //The following code check to see if @@ -6560,7 +6560,7 @@ void moveeffectors(void) //STATNUM 3 if (numplayers > 1) ps[p].oposz = ps[p].posz; } - if ( sprite[j].statnum != 3 ) + if (sprite[j].statnum != 3) { hittype[j].bposz = sprite[j].z; sprite[j].z += q; @@ -6572,9 +6572,9 @@ void moveeffectors(void) //STATNUM 3 j = nextspritesect[j]; } - if ( t[0] ) if (t[0]) //If in motion + if (t[0]) if (t[0]) //If in motion { - if ( klabs(sc->floorz-t[2]) <= SP) + if (klabs(sc->floorz-t[2]) <= SP) { activatewarpelevators(i,0); break; @@ -6582,19 +6582,19 @@ void moveeffectors(void) //STATNUM 3 if (t[0]==-1) { - if ( sc->floorz > t[3] ) + if (sc->floorz > t[3]) break; } - else if ( sc->ceilingz < t[4] ) break; + else if (sc->ceilingz < t[4]) break; - if ( t[1] == 0 ) break; + if (t[1] == 0) break; t[1] = 0; j = headspritestat[3]; while (j >= 0) { - if ( i != j && (sprite[j].lotag) == 17) - if ( (sc->hitag-t[0]) == + if (i != j && (sprite[j].lotag) == 17) + if ((sc->hitag-t[0]) == (sector[sprite[j].sectnum].hitag) && sh == (sprite[j].hitag)) break; @@ -6630,7 +6630,7 @@ void moveeffectors(void) //STATNUM 3 changespritesect(k,sprite[j].sectnum); ps[p].cursectnum = sprite[j].sectnum; } - else if ( sprite[k].statnum != 3 ) + else if (sprite[k].statnum != 3) { sprite[k].x += sprite[j].x-s->x; @@ -6676,9 +6676,9 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if ( ps[sprite[j].yvel].on_ground == 1 ) + if (ps[sprite[j].yvel].on_ground == 1) ps[sprite[j].yvel].posz += sc->extra; - if ( sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) + if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += sc->extra; hittype[j].floorz = sc->floorz; @@ -6710,9 +6710,9 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if ( ps[sprite[j].yvel].on_ground == 1 ) + if (ps[sprite[j].yvel].on_ground == 1) ps[sprite[j].yvel].posz -= sc->extra; - if ( sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) + if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z -= sc->extra; hittype[j].floorz = sc->floorz; @@ -6792,7 +6792,7 @@ void moveeffectors(void) //STATNUM 3 while (l >= 0) { x = sprite[l].lotag&0x7fff; - switch ( x ) + switch (x) { case 0: if (sprite[l].hitag == sh) @@ -6812,8 +6812,8 @@ void moveeffectors(void) //STATNUM 3 // case 18: case 19: - if ( sh == sprite[l].hitag ) - if ( hittype[l].temp_data[0] == 0 ) + if (sh == sprite[l].hitag) + if (hittype[l].temp_data[0] == 0) { hittype[l].temp_data[0] = 1; //Shut them all on sprite[l].owner = i; @@ -6830,11 +6830,11 @@ void moveeffectors(void) //STATNUM 3 case 20: //Extend-o-bridge - if ( t[0] == 0 ) break; - if ( t[0] == 1 ) s->xvel = 8; + if (t[0] == 0) break; + if (t[0] == 1) s->xvel = 8; else s->xvel = -8; - if ( s->xvel ) //Moving + if (s->xvel) //Moving { x = (s->xvel*sintable[(s->ang+512)&2047])>>14; l = (s->xvel*sintable[s->ang&2047])>>14; @@ -6844,7 +6844,7 @@ void moveeffectors(void) //STATNUM 3 s->x += x; s->y += l; - if ( t[3] <= 0 || (t[3]>>6) >= (SP>>6) ) + if (t[3] <= 0 || (t[3]>>6) >= (SP>>6)) { s->x -= x; s->y -= l; @@ -6858,12 +6858,12 @@ void moveeffectors(void) //STATNUM 3 { nextj = nextspritesect[j]; - if ( sprite[j].statnum != 3 && sprite[j].zvel == 0) + if (sprite[j].statnum != 3 && sprite[j].zvel == 0) { sprite[j].x += x; sprite[j].y += l; setsprite(j,sprite[j].x,sprite[j].y,sprite[j].z); - if ( sector[sprite[j].sectnum].floorstat&2 ) + if (sector[sprite[j].sectnum].floorstat&2) if (sprite[j].statnum == 2) makeitfall(j); } @@ -6896,20 +6896,20 @@ void moveeffectors(void) //STATNUM 3 case 21: // Cascading effect - if ( t[0] == 0 ) break; + if (t[0] == 0) break; - if ( s->ang == 1536 ) + if (s->ang == 1536) l = (long) &sc->ceilingz; else l = (long) &sc->floorz; - if ( t[0] == 1 ) //Decide if the s->sectnum should go up or down + if (t[0] == 1) //Decide if the s->sectnum should go up or down { s->zvel = ksgn(s->z-*(long *)l) * (SP<<4); t[0]++; } - if ( sc->extra == 0 ) + if (sc->extra == 0) { *(long *)l += s->zvel; @@ -6924,7 +6924,7 @@ void moveeffectors(void) //STATNUM 3 case 22: - if ( t[1] ) + if (t[1]) { if (getanimationgoal(§or[t[0]].ceilingz) >= 0) sc->ceilingz += sc->extra*9; @@ -6987,9 +6987,9 @@ void moveeffectors(void) //STATNUM 3 ) break; - if ( !(sprite[j].picnum >= CRANE && sprite[j].picnum <= (CRANE+3))) + if (!(sprite[j].picnum >= CRANE && sprite[j].picnum <= (CRANE+3))) { - if ( sprite[j].z > (hittype[j].floorz-(16<<8)) ) + if (sprite[j].z > (hittype[j].floorz-(16<<8))) { hittype[j].bposx = sprite[j].x; hittype[j].bposy = sprite[j].y; @@ -6999,7 +6999,7 @@ void moveeffectors(void) //STATNUM 3 setsprite(j,sprite[j].x,sprite[j].y,sprite[j].z); - if ( sector[sprite[j].sectnum].floorstat&2 ) + if (sector[sprite[j].sectnum].floorstat&2) if (sprite[j].statnum == 2) makeitfall(j); } @@ -7011,7 +7011,7 @@ void moveeffectors(void) //STATNUM 3 p = myconnectindex; if (ps[p].cursectnum == s->sectnum && ps[p].on_ground) - if ( klabs(ps[p].posz-ps[p].truefz) < PHEIGHT+(9<<8) ) + if (klabs(ps[p].posz-ps[p].truefz) < PHEIGHT+(9<<8)) { fricxv += x<<3; fricyv += l<<3; @@ -7030,7 +7030,7 @@ void moveeffectors(void) //STATNUM 3 sprite[k].xvel = 96+(TRAND&127); ssp(k,CLIPMASK0); setsprite(k,sprite[k].x,sprite[k].y,sprite[k].z); - if ( rnd(16) ) + if (rnd(16)) spawn(i,EXPLOSION2); } @@ -7056,11 +7056,11 @@ void moveeffectors(void) //STATNUM 3 case 25: //PISTONS - if ( t[4] == 0 ) break; + if (t[4] == 0) break; if (sc->floorz <= sc->ceilingz) s->shade = 0; - else if ( sc->ceilingz <= t[3]) + else if (sc->ceilingz <= t[3]) s->shade = 1; if (s->shade) @@ -7085,7 +7085,7 @@ void moveeffectors(void) //STATNUM 3 x = (s->xvel*sintable[s->ang&2047])>>14; s->shade++; - if ( s->shade > 7 ) + if (s->shade > 7) { s->x = t[3]; s->y = t[4]; @@ -7096,7 +7096,7 @@ void moveeffectors(void) //STATNUM 3 sc->floorz += s->zvel; j = headspritesect[s->sectnum]; - while ( j >= 0 ) + while (j >= 0) { nextj = nextspritesect[j]; if (sprite[j].statnum != 3 && sprite[j].statnum != 10) @@ -7137,9 +7137,9 @@ void moveeffectors(void) //STATNUM 3 hittype[i].tempang = s->ang; p = findplayer(s,&x); - if ( sprite[ps[p].i].extra > 0 && myconnectindex == screenpeek) + if (sprite[ps[p].i].extra > 0 && myconnectindex == screenpeek) { - if ( t[0] < 0 ) + if (t[0] < 0) { ud.camerasprite = i; t[0]++; @@ -7190,7 +7190,7 @@ void moveeffectors(void) //STATNUM 3 if (T1 == 0) { p = findplayer(s,&x); - if ( x > 15500 ) + if (x > 15500) break; T1 = 1; T2 = 64 + (TRAND&511); @@ -7205,27 +7205,27 @@ void moveeffectors(void) //STATNUM 3 ps[screenpeek].visibility = ud.const_visibility; break; } - else if ( T3 == (T2>>1) ) + else if (T3 == (T2>>1)) spritesound(THUNDER,i); - else if (T3 == (T2>>3) ) + else if (T3 == (T2>>3)) spritesound(LIGHTNING_SLAP,i); - else if ( T3 == (T2>>2) ) + else if (T3 == (T2>>2)) { j = headspritestat[0]; while (j >= 0) { - if ( sprite[j].picnum == NATURALLIGHTNING && sprite[j].hitag == s->hitag) + if (sprite[j].picnum == NATURALLIGHTNING && sprite[j].hitag == s->hitag) sprite[j].cstat |= 32768; j = nextspritestat[j]; } } - else if (T3 > (T2>>3) && T3 < (T2>>2) ) + else if (T3 > (T2>>3) && T3 < (T2>>2)) { - if ( cansee(s->x,s->y,s->z,s->sectnum,ps[screenpeek].posx,ps[screenpeek].posy,ps[screenpeek].posz,ps[screenpeek].cursectnum ) ) + if (cansee(s->x,s->y,s->z,s->sectnum,ps[screenpeek].posx,ps[screenpeek].posy,ps[screenpeek].posz,ps[screenpeek].cursectnum)) j = 1; else j = 0; - if ( rnd(192) && (T3&1) ) + if (rnd(192) && (T3&1)) { if (j) ps[screenpeek].visibility = 0; @@ -7236,16 +7236,16 @@ void moveeffectors(void) //STATNUM 3 j = headspritestat[0]; while (j >= 0) { - if ( sprite[j].picnum == NATURALLIGHTNING && sprite[j].hitag == s->hitag) + if (sprite[j].picnum == NATURALLIGHTNING && sprite[j].hitag == s->hitag) { - if ( rnd(32) && (T3&1) ) + if (rnd(32) && (T3&1)) { sprite[j].cstat &= 32767; spawn(j,SMALLSMOKE); p = findplayer(s,&x); x = ldist(&sprite[ps[p].i], &sprite[j]); - if ( x < 768 ) + if (x < 768) { if (!isspritemakingsound(ps[p].i,DUKE_LONGTERM_PAIN)) spritesound(DUKE_LONGTERM_PAIN,ps[p].i); @@ -7286,7 +7286,7 @@ void moveeffectors(void) //STATNUM 3 { if (SA != 1536) { - if ( klabs( sc->floorz - s->z ) < SP ) + if (klabs(sc->floorz - s->z) < SP) { sc->floorz = s->z; t[2] = 0; @@ -7303,9 +7303,9 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if ( ps[sprite[j].yvel].on_ground == 1 ) + if (ps[sprite[j].yvel].on_ground == 1) ps[sprite[j].yvel].posz += l; - if ( sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) + if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += l; hittype[j].floorz = sc->floorz; @@ -7316,7 +7316,7 @@ void moveeffectors(void) //STATNUM 3 } else { - if ( klabs( sc->floorz - t[1] ) < SP ) + if (klabs(sc->floorz - t[1]) < SP) { sc->floorz = t[1]; callsound(s->sectnum,i); @@ -7333,9 +7333,9 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if ( ps[sprite[j].yvel].on_ground == 1 ) + if (ps[sprite[j].yvel].on_ground == 1) ps[sprite[j].yvel].posz += l; - if ( sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4 ) + if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += l; hittype[j].floorz = sc->floorz; @@ -7347,9 +7347,9 @@ void moveeffectors(void) //STATNUM 3 break; } - if ( (s->ang&2047) == 1536) + if ((s->ang&2047) == 1536) { - if ( klabs( s->z-sc->floorz ) < SP ) + if (klabs(s->z-sc->floorz) < SP) { callsound(s->sectnum,i); t[0] = 0; @@ -7365,9 +7365,9 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if ( ps[sprite[j].yvel].on_ground == 1 ) + if (ps[sprite[j].yvel].on_ground == 1) ps[sprite[j].yvel].posz += l; - if ( sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4 ) + if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += l; hittype[j].floorz = sc->floorz; @@ -7378,7 +7378,7 @@ void moveeffectors(void) //STATNUM 3 } else { - if ( klabs( sc->floorz-t[1] ) < SP ) + if (klabs(sc->floorz-t[1]) < SP) { t[0] = 0; callsound(s->sectnum,i); @@ -7394,9 +7394,9 @@ void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if ( ps[sprite[j].yvel].on_ground == 1 ) + if (ps[sprite[j].yvel].on_ground == 1) ps[sprite[j].yvel].posz -= l; - if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4 ) + if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z -= l; hittype[j].floorz = sc->floorz; @@ -7417,8 +7417,8 @@ void moveeffectors(void) //STATNUM 3 { if (SA != 1536) { - if ( klabs( sc->ceilingz - s->z ) < - (SP<<1) ) + if (klabs(sc->ceilingz - s->z) < + (SP<<1)) { sc->ceilingz = s->z; callsound(s->sectnum,i); @@ -7430,8 +7430,8 @@ void moveeffectors(void) //STATNUM 3 } else { - if ( klabs( sc->ceilingz - t[1] ) < - (SP<<1) ) + if (klabs(sc->ceilingz - t[1]) < + (SP<<1)) { sc->ceilingz = t[1]; callsound(s->sectnum,i); @@ -7444,10 +7444,10 @@ void moveeffectors(void) //STATNUM 3 break; } - if ( (s->ang&2047) == 1536) + if ((s->ang&2047) == 1536) { - if ( klabs(sc->ceilingz-s->z ) < - (SP<<1) ) + if (klabs(sc->ceilingz-s->z) < + (SP<<1)) { t[0] = 0; t[2] = !t[2]; @@ -7459,7 +7459,7 @@ void moveeffectors(void) //STATNUM 3 } else { - if ( klabs(sc->ceilingz-t[1] ) < (SP<<1) ) + if (klabs(sc->ceilingz-t[1]) < (SP<<1)) { t[0] = 0; t[2] = !t[2]; @@ -7471,16 +7471,16 @@ void moveeffectors(void) //STATNUM 3 break; case 33: - if ( earthquaketime > 0 && (TRAND&7) == 0 ) + if (earthquaketime > 0 && (TRAND&7) == 0) RANDOMSCRAP; break; case 36: - if ( t[0] ) + if (t[0]) { - if ( t[0] == 1 ) + if (t[0] == 1) shoot(i,sc->extra); - else if ( t[0] == 26*5 ) + else if (t[0] == 26*5) t[0] = 0; t[0]++; } @@ -7522,7 +7522,7 @@ void moveeffectors(void) //STATNUM 3 x = sc->floorz-sc->ceilingz; - if ( rnd(64) ) + if (rnd(64)) { k = spawn(i,EXPLOSION2); sprite[k].xrepeat = sprite[k].yrepeat = 2+(TRAND&7); @@ -7538,7 +7538,7 @@ void moveeffectors(void) //STATNUM 3 x = sc->floorz-sc->ceilingz; - if ( rnd(32) ) + if (rnd(32)) { k = spawn(i,EXPLOSION2); sprite[k].xrepeat = sprite[k].yrepeat = 2+(TRAND&3); diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index 1f29c72ff..ce4c7ed93 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -207,7 +207,7 @@ void playanm(char *fn,char t) if (t != 7 && t != 9 && t != 10 && t != 11) KB_FlushKeyboardQueue(); - if ( KB_KeyWaiting() ) + if (KB_KeyWaiting()) { FX_StopAllSounds(); goto ENDOFANIMLOOP; @@ -227,7 +227,7 @@ void playanm(char *fn,char t) kread(handle,animbuf,length); kclose(handle); - ANIM_LoadAnim (animbuf); + ANIM_LoadAnim(animbuf); numframes = ANIM_NumFrames(); palptr = ANIM_GetPalette(); @@ -257,7 +257,7 @@ void playanm(char *fn,char t) while (totalclock < ototalclock) { extern char restorepalette; - if ( KB_KeyWaiting() ) + if (KB_KeyWaiting()) goto ENDOFANIMLOOP; handleevents(); getpackets(); if (restorepalette == 1) @@ -291,6 +291,6 @@ void playanm(char *fn,char t) ENDOFANIMLOOP: - ANIM_FreeAnim (); + ANIM_FreeAnim(); walock[TILE_ANIM] = 1; } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index f2e9560d7..dde46b79c 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -471,7 +471,7 @@ const char *ExtGetSpriteCaption(short spritenum) } } - if ( onnames==6 && sprite[spritenum].picnum != sprite[cursprite].picnum) + if (onnames==6 && sprite[spritenum].picnum != sprite[cursprite].picnum) { tempbuf[0] = 0; return(tempbuf); @@ -1156,7 +1156,7 @@ static void ExtSE40Draw(int spnum,long x,long y,long z,short a,short h) for (j=0;j>2))<<16,(114)<<16,32768,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L); - else if (tabgraphic == 2 ) + else if (tabgraphic == 2) rotatesprite((44+(tilesizx[temppicnum]>>2))<<16,(114)<<16,16384,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L); begindrawing(); @@ -3681,8 +3681,8 @@ void Keys2d(void) (search_hitag!=0 && search_hitag==wall[i].hitag)) ) { - posx=(wall[i].x)-(( (wall[i].x)-(wall[wall[i].point2].x) )/2); - posy=(wall[i].y)-(( (wall[i].y)-(wall[wall[i].point2].y) )/2); + posx=(wall[i].x)-(((wall[i].x)-(wall[wall[i].point2].x))/2); + posy=(wall[i].y)-(((wall[i].y)-(wall[wall[i].point2].y))/2); printmessage16("< Wall search: found"); // curwallnum--; keystatus[0x1a]=0; @@ -3702,7 +3702,7 @@ void Keys2d(void) if ( (sprite[i].picnum==sprite[cursearchsprite].picnum && - sprite[i].statnum==0 ) + sprite[i].statnum==0) &&((search_lotag==0)|| (search_lotag!=0 && search_lotag==sprite[i].lotag)) &&((search_hitag==0)|| @@ -3746,8 +3746,8 @@ void Keys2d(void) (search_hitag!=0 && search_hitag==wall[i].hitag)) ) { - posx=(wall[i].x)-(( (wall[i].x)-(wall[wall[i].point2].x) )/2); - posy=(wall[i].y)-(( (wall[i].y)-(wall[wall[i].point2].y) )/2); + posx=(wall[i].x)-(((wall[i].x)-(wall[wall[i].point2].x))/2); + posy=(wall[i].y)-(((wall[i].y)-(wall[wall[i].point2].y))/2); printmessage16("> Wall search: found"); // curwallnum++; keystatus[0x1b]=0; @@ -3766,7 +3766,7 @@ void Keys2d(void) { if ( (sprite[i].picnum==sprite[cursearchsprite].picnum && - sprite[i].statnum==0 ) + sprite[i].statnum==0) &&((search_lotag==0)|| (search_lotag!=0 && search_lotag==sprite[i].lotag)) &&((search_hitag==0)|| @@ -4181,7 +4181,7 @@ int loadgroupfiles(char *fn) { int j = initgroupfile(fn); - if ( j == -1 ) + if (j == -1) initprintf("Could not find GRP file %s.\n",fn); else initprintf("Using GRP file %s.\n",fn); @@ -4275,7 +4275,7 @@ int ExtInit(void) "textures and skins, but textures will load dramatically " "faster after the first time they are loaded."); if (i) i = 'y'; - if (i == 'y' || i == 'Y' ) + if (i == 'y' || i == 'Y') glusetexcompr = glusetexcache = glusetexcachecompression = 1; else glusetexcache = glusetexcachecompression = 0; } diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index c0eb6694c..2089ab410 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -109,7 +109,7 @@ static int32 setupread=0; =================== */ -int32 CONFIG_FunctionNameToNum( char * func ) +int32 CONFIG_FunctionNameToNum(char * func) { int32 i; @@ -138,7 +138,7 @@ int32 CONFIG_FunctionNameToNum( char * func ) =================== */ -char * CONFIG_FunctionNumToName( int32 func ) +char * CONFIG_FunctionNumToName(int32 func) { if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS) { @@ -159,7 +159,7 @@ char * CONFIG_FunctionNumToName( int32 func ) */ -int32 CONFIG_AnalogNameToNum( char * func ) +int32 CONFIG_AnalogNameToNum(char * func) { if (!Bstrcasecmp(func,"analog_turning")) @@ -183,7 +183,7 @@ int32 CONFIG_AnalogNameToNum( char * func ) } -char * CONFIG_AnalogNumToName( int32 func ) +char * CONFIG_AnalogNumToName(int32 func) { switch (func) { case analog_turning: @@ -208,7 +208,7 @@ char * CONFIG_AnalogNumToName( int32 func ) =================== */ -void CONFIG_SetDefaults( void ) +void CONFIG_SetDefaults(void) { // JBF 20031211 int32 i,f; @@ -278,45 +278,45 @@ void CONFIG_SetDefaults( void ) // JBF 20031211 memset(KeyboardKeys, 0xff, sizeof(KeyboardKeys)); for (i=0; i < (int32)(sizeof(keydefaults)/sizeof(keydefaults[0])); i+=3) { - f = CONFIG_FunctionNameToNum( keydefaults[i+0] ); + f = CONFIG_FunctionNameToNum(keydefaults[i+0]); if (f == -1) continue; - KeyboardKeys[f][0] = KB_StringToScanCode( keydefaults[i+1] ); - KeyboardKeys[f][1] = KB_StringToScanCode( keydefaults[i+2] ); + KeyboardKeys[f][0] = KB_StringToScanCode(keydefaults[i+1]); + KeyboardKeys[f][1] = KB_StringToScanCode(keydefaults[i+2]); if (f == gamefunc_Show_Console) OSD_CaptureKey(KeyboardKeys[f][0]); - else CONTROL_MapKey( f, KeyboardKeys[f][0], KeyboardKeys[f][1] ); + else CONTROL_MapKey(f, KeyboardKeys[f][0], KeyboardKeys[f][1]); } memset(MouseFunctions, -1, sizeof(MouseFunctions)); for (i=0; i=4) continue; - MouseFunctions[i][1] = CONFIG_FunctionNameToNum( mouseclickeddefaults[i] ); - CONTROL_MapButton( MouseFunctions[i][1], i, 1, controldevice_mouse ); + MouseFunctions[i][1] = CONFIG_FunctionNameToNum(mouseclickeddefaults[i]); + CONTROL_MapButton(MouseFunctions[i][1], i, 1, controldevice_mouse); } memset(MouseDigitalFunctions, -1, sizeof(MouseDigitalFunctions)); for (i=0; i 10) tempbuf[Bstrlen(tempbuf)-1] = '\0'; @@ -611,69 +611,69 @@ int32 CONFIG_ReadSetup( void ) Bstrncpy(myname,tempbuf,sizeof(myname)-1); myname[sizeof(myname)] = '\0'; - SCRIPT_GetString( scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]); + SCRIPT_GetString(scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "Shadows",&ud.shadows); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "Shadows",&ud.shadows); if (!NAM) { - SCRIPT_GetString( scripthandle, "Screen Setup","Password",&ud.pwlockout[0]); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "Out",&ud.lockout); + SCRIPT_GetString(scripthandle, "Screen Setup","Password",&ud.pwlockout[0]); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "Out",&ud.lockout); } - SCRIPT_GetNumber( scripthandle, "Screen Setup", "Detail",&ud.detail); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "Tilt",&ud.screen_tilting); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "Messages",&ud.fta_on); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenWidth",&ScreenWidth); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenHeight",&ScreenHeight); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenMode",&ScreenMode); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenGamma",&ud.brightness); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "Detail",&ud.detail); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "Tilt",&ud.screen_tilting); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "Messages",&ud.fta_on); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenWidth",&ScreenWidth); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenHeight",&ScreenHeight); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenMode",&ScreenMode); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenGamma",&ud.brightness); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size); #if defined(POLYMOST) && defined(USE_OPENGL) - SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenBPP", &ScreenBPP); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenBPP", &ScreenBPP); if (ScreenBPP < 8) ScreenBPP = 32; #endif #ifdef RENDERTYPEWIN - SCRIPT_GetNumber( scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq); #endif #if defined(POLYMOST) && defined(USE_OPENGL) - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLWidescreen", &glwidescreen); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLWidescreen", &glwidescreen); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache); - SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseTextureCacheCompression", &glusetexcachecompression); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache); + SCRIPT_GetNumber(scripthandle, "Screen Setup", "GLUseTextureCacheCompression", &glusetexcachecompression); - dummy = usemodels; SCRIPT_GetNumber( scripthandle, "Screen Setup", "UseModels",&dummy); usemodels = dummy != 0; - dummy = usehightile; SCRIPT_GetNumber( scripthandle, "Screen Setup", "UseHightile",&dummy); usehightile = dummy != 0; + dummy = usemodels; SCRIPT_GetNumber(scripthandle, "Screen Setup", "UseModels",&dummy); usemodels = dummy != 0; + dummy = usehightile; SCRIPT_GetNumber(scripthandle, "Screen Setup", "UseHightile",&dummy); usehightile = dummy != 0; #endif - SCRIPT_GetNumber( scripthandle, "Misc", "Executions",&ud.executions); - SCRIPT_GetNumber( scripthandle, "Setup", "ForceSetup",&ForceSetup); - SCRIPT_GetNumber( scripthandle, "Misc", "RunMode",&RunMode); - SCRIPT_GetNumber( scripthandle, "Misc", "Crosshairs",&ud.crosshair); - SCRIPT_GetNumber( scripthandle, "Misc", "StatusBarScale",&ud.statusbarscale); - SCRIPT_GetNumber( scripthandle, "Misc", "ShowLevelStats",&ud.levelstats); - SCRIPT_GetNumber( scripthandle, "Misc", "ShowOpponentWeapons",&ShowOpponentWeapons); + SCRIPT_GetNumber(scripthandle, "Misc", "Executions",&ud.executions); + SCRIPT_GetNumber(scripthandle, "Setup", "ForceSetup",&ForceSetup); + SCRIPT_GetNumber(scripthandle, "Misc", "RunMode",&RunMode); + SCRIPT_GetNumber(scripthandle, "Misc", "Crosshairs",&ud.crosshair); + SCRIPT_GetNumber(scripthandle, "Misc", "StatusBarScale",&ud.statusbarscale); + SCRIPT_GetNumber(scripthandle, "Misc", "ShowLevelStats",&ud.levelstats); + SCRIPT_GetNumber(scripthandle, "Misc", "ShowOpponentWeapons",&ShowOpponentWeapons); ud.showweapons = ShowOpponentWeapons; - SCRIPT_GetNumber( scripthandle, "Misc", "ShowViewWeapon",&ud.drawweapon); - SCRIPT_GetNumber( scripthandle, "Misc", "DemoCams",&ud.democams); - SCRIPT_GetNumber( scripthandle, "Misc", "ShowFPS",&ud.tickrate); - SCRIPT_GetNumber( scripthandle, "Misc", "Color",&ud.color); + SCRIPT_GetNumber(scripthandle, "Misc", "ShowViewWeapon",&ud.drawweapon); + SCRIPT_GetNumber(scripthandle, "Misc", "DemoCams",&ud.democams); + SCRIPT_GetNumber(scripthandle, "Misc", "ShowFPS",&ud.tickrate); + SCRIPT_GetNumber(scripthandle, "Misc", "Color",&ud.color); check_player_color((int *)&ud.color,-1); ps[0].palookup = ud.pcolor[0] = ud.color; - SCRIPT_GetNumber( scripthandle, "Misc", "Team",&ud.team); + SCRIPT_GetNumber(scripthandle, "Misc", "Team",&ud.team); if (ud.team > 1) ud.team = 0; ud.pteam[0] = ud.team; - SCRIPT_GetNumber( scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime); - SCRIPT_GetNumber( scripthandle, "Misc", "StatusBarMode",&ud.statusbarmode); - SCRIPT_GetNumber( scripthandle, "Misc", "AutoVote",&ud.autovote); - SCRIPT_GetNumber( scripthandle, "Misc", "AutoMsg",&ud.automsg); - SCRIPT_GetNumber( scripthandle, "Misc", "IDPlayers",&ud.automsg); + SCRIPT_GetNumber(scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime); + SCRIPT_GetNumber(scripthandle, "Misc", "StatusBarMode",&ud.statusbarmode); + SCRIPT_GetNumber(scripthandle, "Misc", "AutoVote",&ud.autovote); + SCRIPT_GetNumber(scripthandle, "Misc", "AutoMsg",&ud.automsg); + SCRIPT_GetNumber(scripthandle, "Misc", "IDPlayers",&ud.automsg); - dummy = useprecache; SCRIPT_GetNumber( scripthandle, "Misc", "UsePrecache",&dummy); useprecache = dummy != 0; + dummy = useprecache; SCRIPT_GetNumber(scripthandle, "Misc", "UsePrecache",&dummy); useprecache = dummy != 0; // weapon choices are defaulted in checkcommandline, which may override them if (!CommandWeaponChoice) @@ -681,37 +681,37 @@ int32 CONFIG_ReadSetup( void ) { Bsprintf(buf,"WeaponChoice%ld",i); dummy = -1; - SCRIPT_GetNumber( scripthandle, "Misc", buf, &dummy); + SCRIPT_GetNumber(scripthandle, "Misc", buf, &dummy); if (dummy >= 0) ud.wchoice[0][i] = dummy; } - SCRIPT_GetNumber( scripthandle, "Sound Setup", "FXDevice",&FXDevice); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "MusicDevice",&MusicDevice); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "FXVolume",&FXVolume); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "MusicVolume",&MusicVolume); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "SoundToggle",&SoundToggle); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "MusicToggle",&MusicToggle); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "VoiceToggle",&VoiceToggle); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "AmbienceToggle",&AmbienceToggle); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "NumVoices",&NumVoices); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "NumChannels",&NumChannels); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "NumBits",&NumBits); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "MixRate",&MixRate); - SCRIPT_GetNumber( scripthandle, "Sound Setup", "ReverseStereo",&ReverseStereo); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "FXDevice",&FXDevice); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "MusicDevice",&MusicDevice); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "FXVolume",&FXVolume); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "MusicVolume",&MusicVolume); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "SoundToggle",&SoundToggle); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "MusicToggle",&MusicToggle); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "VoiceToggle",&VoiceToggle); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "AmbienceToggle",&AmbienceToggle); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "NumVoices",&NumVoices); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "NumChannels",&NumChannels); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "NumBits",&NumBits); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "MixRate",&MixRate); + SCRIPT_GetNumber(scripthandle, "Sound Setup", "ReverseStereo",&ReverseStereo); - SCRIPT_GetNumber( scripthandle, "Controls","MouseAimingFlipped",&ud.mouseflip); // mouse aiming inverted - SCRIPT_GetNumber( scripthandle, "Controls","MouseAiming",&ud.mouseaiming); // 1=momentary/0=toggle + SCRIPT_GetNumber(scripthandle, "Controls","MouseAimingFlipped",&ud.mouseflip); // mouse aiming inverted + SCRIPT_GetNumber(scripthandle, "Controls","MouseAiming",&ud.mouseaiming); // 1=momentary/0=toggle ps[0].aim_mode = ud.mouseaiming; - SCRIPT_GetNumber( scripthandle, "Controls","MouseBias",&MouseBias); - SCRIPT_GetNumber( scripthandle, "Controls","MouseFilter",&MouseFilter); - SCRIPT_GetNumber( scripthandle, "Controls","SmoothInput",&SmoothInput); - SCRIPT_GetNumber( scripthandle, "Controls","UseJoystick",&UseJoystick); - SCRIPT_GetNumber( scripthandle, "Controls","UseMouse",&UseMouse); - SCRIPT_GetNumber( scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state - SCRIPT_GetNumber( scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125 - SCRIPT_GetNumber( scripthandle, "Controls","AutoAim",&AutoAim); // JBF 20031125 + SCRIPT_GetNumber(scripthandle, "Controls","MouseBias",&MouseBias); + SCRIPT_GetNumber(scripthandle, "Controls","MouseFilter",&MouseFilter); + SCRIPT_GetNumber(scripthandle, "Controls","SmoothInput",&SmoothInput); + SCRIPT_GetNumber(scripthandle, "Controls","UseJoystick",&UseJoystick); + SCRIPT_GetNumber(scripthandle, "Controls","UseMouse",&UseMouse); + SCRIPT_GetNumber(scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state + SCRIPT_GetNumber(scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125 + SCRIPT_GetNumber(scripthandle, "Controls","AutoAim",&AutoAim); // JBF 20031125 ps[0].auto_aim = AutoAim; - SCRIPT_GetNumber( scripthandle, "Controls","WeaponSwitchMode",&ud.weaponswitch); + SCRIPT_GetNumber(scripthandle, "Controls","WeaponSwitchMode",&ud.weaponswitch); ps[0].weaponswitch = ud.weaponswitch; } @@ -731,7 +731,7 @@ int32 CONFIG_ReadSetup( void ) =================== */ -void CONFIG_WriteSetup( void ) +void CONFIG_WriteSetup(void) { int32 dummy; @@ -740,102 +740,102 @@ void CONFIG_WriteSetup( void ) if (scripthandle < 0) scripthandle = SCRIPT_Init(setupfilename); - SCRIPT_PutNumber( scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","AutoAim",AutoAim,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","MouseBias",MouseBias,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","MouseFilter",MouseFilter,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","SmoothInput",SmoothInput,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false); - SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","AutoAim",AutoAim,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","MouseBias",MouseBias,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","MouseFilter",MouseFilter,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","SmoothInput",SmoothInput,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","UseJoystick",UseJoystick,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","UseMouse",UseMouse,false,false); + SCRIPT_PutNumber(scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "AutoMsg",ud.automsg,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "AutoVote",ud.autovote,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "Color",ud.color,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "DemoCams",ud.democams,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "AutoMsg",ud.automsg,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "AutoVote",ud.autovote,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "Color",ud.color,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "DemoCams",ud.democams,false,false); ud.executions++; - SCRIPT_PutNumber( scripthandle, "Misc", "Executions",ud.executions,false,false); - SCRIPT_PutNumber( scripthandle, "Setup", "ForceSetup",ForceSetup,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "IDPlayers",ud.idplayers,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "RunMode",RunMode,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "ShowLevelStats",ud.levelstats,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "ShowOpponentWeapons",ShowOpponentWeapons,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "ShowViewWeapon",ud.drawweapon,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "Team",ud.team,false,false); - SCRIPT_PutNumber( scripthandle, "Misc", "UsePrecache",useprecache,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "Executions",ud.executions,false,false); + SCRIPT_PutNumber(scripthandle, "Setup", "ForceSetup",ForceSetup,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "IDPlayers",ud.idplayers,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "RunMode",RunMode,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "ShowLevelStats",ud.levelstats,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "ShowOpponentWeapons",ShowOpponentWeapons,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "ShowViewWeapon",ud.drawweapon,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "Team",ud.team,false,false); + SCRIPT_PutNumber(scripthandle, "Misc", "UsePrecache",useprecache,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "Detail",ud.detail,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "Detail",ud.detail,false,false); #if defined(POLYMOST) && defined(USE_OPENGL) - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLWidescreen",glwidescreen,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "GLWidescreen",glwidescreen,false,false); #endif #ifdef RENDERTYPEWIN - SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false); #endif - SCRIPT_PutNumber( scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false); if (!NAM) { - SCRIPT_PutNumber( scripthandle, "Screen Setup", "Out",ud.lockout,false,false); - SCRIPT_PutString( scripthandle, "Screen Setup", "Password",ud.pwlockout); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "Out",ud.lockout,false,false); + SCRIPT_PutString(scripthandle, "Screen Setup", "Password",ud.pwlockout); } - SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenBPP",ScreenBPP,false,false); // JBF 20040523 - SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenHeight",ScreenHeight,false,false); // JBF 20031206 - SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenMode",ScreenMode,false,false); // JBF 20031206 - SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenWidth",ScreenWidth,false,false); // JBF 20031206 - SCRIPT_PutNumber( scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "ScreenBPP",ScreenBPP,false,false); // JBF 20040523 + SCRIPT_PutNumber(scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "ScreenHeight",ScreenHeight,false,false); // JBF 20031206 + SCRIPT_PutNumber(scripthandle, "Screen Setup", "ScreenMode",ScreenMode,false,false); // JBF 20031206 + SCRIPT_PutNumber(scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "ScreenWidth",ScreenWidth,false,false); // JBF 20031206 + SCRIPT_PutNumber(scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false); #if defined(POLYMOST) && defined(USE_OPENGL) - SCRIPT_PutNumber( scripthandle, "Screen Setup", "UseHightile",usehightile,false,false); - SCRIPT_PutNumber( scripthandle, "Screen Setup", "UseModels",usemodels,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "UseHightile",usehightile,false,false); + SCRIPT_PutNumber(scripthandle, "Screen Setup", "UseModels",usemodels,false,false); #endif - SCRIPT_PutNumber( scripthandle, "Sound Setup", "AmbienceToggle",AmbienceToggle,false,false); - SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false); - SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false); - SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false); - SCRIPT_PutNumber( scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false); - SCRIPT_PutNumber( scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false); - SCRIPT_PutNumber( scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "AmbienceToggle",AmbienceToggle,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false); + SCRIPT_PutNumber(scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false); // JBF 20031211 for (dummy=0;dummy= (MAXMOUSEBUTTONS-2)) continue; Bsprintf(buf,"MouseButtonClicked%ld",dummy); - SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( MouseFunctions[dummy][1] )); + SCRIPT_PutString(scripthandle,"Controls", buf, CONFIG_FunctionNumToName(MouseFunctions[dummy][1])); } for (dummy=0;dummy>1) ); + centre = (x == (320>>1)); newx = 0; oldt = t; @@ -264,7 +264,7 @@ int gametext_(int small, int starttile, int x,int y,char *t,char s,char p,short if (*t == 32) {newx+=5;t++;continue;} else ac = *t - '!' + starttile; - if ( ac < starttile || ac > (starttile + 93) ) break; + if (ac < starttile || ac > (starttile + 93)) break; if (*t >= '0' && *t <= '9') newx += 8; @@ -298,7 +298,7 @@ int gametext_(int small, int starttile, int x,int y,char *t,char s,char p,short if (*t == 32) {x+=5;t++;continue;} else ac = *t - '!' + starttile; - if ( ac < starttile || ac > (starttile + 93) ) + if (ac < starttile || ac > (starttile + 93)) break; rotatesprite(x<<16,(y<<16)+(small?ScreenHeight<<15:0),65536,0,ac,s,p,small?(8|16):(2|orientation),x1,y1,x2,y2); @@ -435,7 +435,7 @@ void getpackets(void) } // only dispatch commands here when not in a game -if ( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } +if (!(ps[myconnectindex].gm&MODE_GAME)) { OSD_DispatchQueued(); } if (qe == 0 && KB_KeyPressed(sc_LeftControl) && KB_KeyPressed(sc_LeftAlt) && KB_KeyPressed(sc_Delete)) { @@ -478,8 +478,8 @@ if ( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } if (numplayers < 2) sound(GENERIC_AMBIENCE17); - if(i == 0 && networkmode == 0 ) */ - gameexit( "Game aborted from menu; disconnected."); + if(i == 0 && networkmode == 0) */ + gameexit("Game aborted from menu; disconnected."); // } break; @@ -574,7 +574,7 @@ if ( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } multiwhat = 0; multiwho = packbuf[2]; //other: need to send in m/s mode because of possible re-transmit multipos = packbuf[1]; - loadplayer( multipos ); + loadplayer(multipos); multiflag = 0; break; case 0: //[0] (receive master sync buffer) @@ -786,7 +786,7 @@ if ( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } if (numlumps == 0) break; - if (SoundToggle == 0 || ud.lockout == 1 || FXDevice < 0 ) + if (SoundToggle == 0 || ud.lockout == 1 || FXDevice < 0) break; rtsptr = (char *)RTS_GetSound(packbuf[1]-1); if (*rtsptr == 'C') @@ -1101,7 +1101,7 @@ void faketimerhandler() if (playerquitflag[i] && (movefifoend[i] <= movefifosendplc)) return; osyn = (input *)&inputfifo[(movefifosendplc-1)&(MOVEFIFOSIZ-1)][0]; - nsyn = (input *)&inputfifo[(movefifosendplc )&(MOVEFIFOSIZ-1)][0]; + nsyn = (input *)&inputfifo[(movefifosendplc)&(MOVEFIFOSIZ-1)][0]; //MASTER -> SLAVE packet packbuf[0] = 0; j = 1; @@ -1347,7 +1347,7 @@ inline short badguypic(short pn) if (checkspriteflagsp(pn,SPRITE_FLAG_BADGUY)) return 1; - if ( actortype[pn] ) return 1; + if (actortype[pn]) return 1; switch (dynamictostatic[pn]) { @@ -1549,7 +1549,7 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) if (u != -1) patchstatusbar(88,178,88+37,178+6); //original code: (96,178,96+12,178+6); weaponnum999(PISTOL_WEAPON,x,y, p->ammo_amount[PISTOL_WEAPON],max_ammo_amount[PISTOL_WEAPON], - 12-20*(cw == PISTOL_WEAPON) ); + 12-20*(cw == PISTOL_WEAPON)); } if (u&8) { @@ -1557,7 +1557,7 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) weaponnum999(SHOTGUN_WEAPON,x,y+6, p->ammo_amount[SHOTGUN_WEAPON],max_ammo_amount[SHOTGUN_WEAPON], (!p->gotweapon[SHOTGUN_WEAPON]*9)+12-18* - (cw == SHOTGUN_WEAPON) ); + (cw == SHOTGUN_WEAPON)); } if (u&16) { @@ -1565,7 +1565,7 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) weaponnum999(CHAINGUN_WEAPON,x,y+12, p->ammo_amount[CHAINGUN_WEAPON],max_ammo_amount[CHAINGUN_WEAPON], (!p->gotweapon[CHAINGUN_WEAPON]*9)+12-18* - (cw == CHAINGUN_WEAPON) ); + (cw == CHAINGUN_WEAPON)); } if (u&32) { @@ -1573,7 +1573,7 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) weaponnum(RPG_WEAPON,x+39,y, p->ammo_amount[RPG_WEAPON],max_ammo_amount[RPG_WEAPON], (!p->gotweapon[RPG_WEAPON]*9)+12-19* - (cw == RPG_WEAPON) ); + (cw == RPG_WEAPON)); } if (u&64) { @@ -1590,18 +1590,18 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) if (VOLUMEONE) { orderweaponnum(SHRINKER_WEAPON,x+39,y+12, (!p->gotweapon[SHRINKER_WEAPON]*9)+12-18* - (cw == SHRINKER_WEAPON) ); + (cw == SHRINKER_WEAPON)); } else { if (p->subweapon&(1<ammo_amount[GROW_WEAPON],max_ammo_amount[GROW_WEAPON], (!p->gotweapon[GROW_WEAPON]*9)+12-18* - (cw == GROW_WEAPON) ); + (cw == GROW_WEAPON)); else weaponnum(SHRINKER_WEAPON,x+39,y+12, p->ammo_amount[SHRINKER_WEAPON],max_ammo_amount[SHRINKER_WEAPON], (!p->gotweapon[SHRINKER_WEAPON]*9)+12-18* - (cw == SHRINKER_WEAPON) ); + (cw == SHRINKER_WEAPON)); } } if (u&256) @@ -1611,12 +1611,12 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) if (VOLUMEONE) { orderweaponnum(DEVISTATOR_WEAPON,x+70,y, (!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18* - (cw == DEVISTATOR_WEAPON) ); + (cw == DEVISTATOR_WEAPON)); } else { weaponnum(DEVISTATOR_WEAPON,x+70,y, p->ammo_amount[DEVISTATOR_WEAPON],max_ammo_amount[DEVISTATOR_WEAPON], (!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18* - (cw == DEVISTATOR_WEAPON) ); + (cw == DEVISTATOR_WEAPON)); } } if (u&512) @@ -1625,12 +1625,12 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) if (VOLUMEONE) { orderweaponnum(TRIPBOMB_WEAPON,x+70,y+6, (!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18* - (cw == TRIPBOMB_WEAPON) ); + (cw == TRIPBOMB_WEAPON)); } else { weaponnum(TRIPBOMB_WEAPON,x+70,y+6, p->ammo_amount[TRIPBOMB_WEAPON],max_ammo_amount[TRIPBOMB_WEAPON], (!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18* - (cw == TRIPBOMB_WEAPON) ); + (cw == TRIPBOMB_WEAPON)); } } @@ -1640,12 +1640,12 @@ void weapon_amounts(struct player_struct *p,long x,long y,long u) if (VOLUMEONE) { orderweaponnum(-1,x+70,y+12, (!p->gotweapon[FREEZE_WEAPON]*9)+12-18* - (cw == FREEZE_WEAPON) ); + (cw == FREEZE_WEAPON)); } else { weaponnum(-1,x+70,y+12, p->ammo_amount[FREEZE_WEAPON],max_ammo_amount[FREEZE_WEAPON], (!p->gotweapon[FREEZE_WEAPON]*9)+12-18* - (cw == FREEZE_WEAPON) ); + (cw == FREEZE_WEAPON)); } } } @@ -1729,9 +1729,9 @@ void displayinventory(struct player_struct *p) j = xoff = 0; n = (p->jetpack_amount > 0)<<3; if (n&8) j++; - n |= ( p->scuba_amount > 0 )<<5; if (n&32) j++; + n |= (p->scuba_amount > 0)<<5; if (n&32) j++; n |= (p->steroids_amount > 0)<<1; if (n&2) j++; - n |= ( p->holoduke_amount > 0)<<2; if (n&4) j++; + n |= (p->holoduke_amount > 0)<<2; if (n&4) j++; n |= (p->firstaid_amount > 0); if (n&1) j++; n |= (p->heat_amount > 0)<<4; if (n&16) j++; n |= (p->boot_amount > 0)<<6; if (n&64) j++; @@ -1751,11 +1751,11 @@ void displayinventory(struct player_struct *p) else xoff += 65; } - while ( j <= 9 ) + while (j <= 9) { - if ( n&(1<= 400 && current_menu <= 405) ) + if ((current_menu >= 400 && current_menu <= 405)) return; ss = ud.screen_size; if (ss < 4) return; if (getrendermode() >= 3) pus = NUMPAGES; // JBF 20040101: always redraw in GL - if ( ud.multimode > 1 && (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR)) + if (ud.multimode > 1 && (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR)) { if (pus) { displayfragbar(); } @@ -1948,7 +1948,7 @@ if (sbar.frag[myconnectindex] != p->frag) { sbar.frag[myconnectindex] = p->frag; if (sbar.gotweapon[i] != p->gotweapon[i]) { sbar.gotweapon[i] = p->gotweapon[i]; - if (i < 9 ) + if (i < 9) u |= ((2<ftq] != NULL) { - if ( ud.fta_on == 1) + if (ud.fta_on == 1) { - if ( p->fta > 0 && q != 115 && q != 116 ) - if ( p->ftq == 115 || p->ftq == 116 ) return; + if (p->fta > 0 && q != 115 && q != 116) + if (p->ftq == 115 || p->ftq == 116) return; p->fta = 100; - // if( p->ftq != q || q == 26 ) - // || q == 26 || q == 115 || q ==116 || q == 117 || q == 122 ) + // if(p->ftq != q || q == 26) + // || q == 26 || q == 115 || q ==116 || q == 117 || q == 122) { p->ftq = q; pub = NUMPAGES; @@ -2294,13 +2294,13 @@ void showtwoscreens(void) KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,3291,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-7); else nextpage(); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } fadepal(0,0,0, 0,64,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,3290,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-7); else nextpage(); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } } @@ -2343,7 +2343,7 @@ else if (ud.recstat == 2) { if (frecfilep) fclose(frecfilep); } // JBF: fixes cr setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP); } - if ( *t != 0 && *(t+1) != 'V' && *(t+1) != 'Y') + if (*t != 0 && *(t+1) != 'V' && *(t+1) != 'Y') showtwoscreens(); } @@ -2379,7 +2379,7 @@ short strget_(int small,short x,short y,char *t,short dalen,short c) { if (ch == asc_BackSpace) { - if ( inputloc > 0 ) + if (inputloc > 0) { inputloc--; *(t+inputloc) = 0; @@ -2398,7 +2398,7 @@ short strget_(int small,short x,short y,char *t,short dalen,short c) KB_ClearKeyDown(sc_Escape); return (-1); } - else if ( ch >= 32 && inputloc < dalen && ch < 127) + else if (ch >= 32 && inputloc < dalen && ch < 127) { ch = Btoupper(ch); if (c != 997 || (ch >= '0' && ch <= '9')) { // JBF 20040508: so we can have numeric only if we want @@ -2410,8 +2410,8 @@ short strget_(int small,short x,short y,char *t,short dalen,short c) } } - if ( c == 999 ) return(0); - if ( c == 998 ) + if (c == 999) return(0); + if (c == 998) { char b[91],ii; for (ii=0;ii 0) j = 200-45; else j = 200-8; mpgametext(j,typebuf,0,2+8+16); - if ( KB_KeyWaiting() ) + if (KB_KeyWaiting()) { i = KB_GetCh(); if (i == 'A' || i == 'a' || i == 13) sendmessagecommand = ud.multimode; - else if (i >= '1' || i <= (ud.multimode + '1') ) + else if (i >= '1' || i <= (ud.multimode + '1')) sendmessagecommand = i - '1'; else { @@ -2607,7 +2607,7 @@ void typemode(void) void moveclouds(void) { - if ( totalclock > cloudtotalclock || totalclock < (cloudtotalclock-7)) + if (totalclock > cloudtotalclock || totalclock < (cloudtotalclock-7)) { short i; @@ -2699,7 +2699,7 @@ void drawoverheadmap(long cposx, long cposy, long czoom, short cang) sprx = spr->x; spry = spr->y; - if ( (spr->cstat&257) != 0) switch (spr->cstat&48) + if ((spr->cstat&257) != 0) switch (spr->cstat&48) { case 0: break; @@ -2725,7 +2725,7 @@ void drawoverheadmap(long cposx, long cposy, long czoom, short cang) break; case 16: - if ( spr->picnum == LASERLINE ) + if (spr->picnum == LASERLINE) { x1 = sprx; y1 = spry; tilenum = spr->picnum; @@ -2853,7 +2853,7 @@ void drawoverheadmap(long cposx, long cposy, long czoom, short cang) x1 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16); y1 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16); - if (p == screenpeek || GTFLAGS(GAMETYPE_FLAG_OTHERPLAYERSINMAP) ) + if (p == screenpeek || GTFLAGS(GAMETYPE_FLAG_OTHERPLAYERSINMAP)) { if (sprite[ps[p].i].xvel > 16 && ps[p].on_ground) i = APLAYERTOP+((totalclock>>4)&3); @@ -2893,7 +2893,7 @@ void palto(char r,char g,char b,long e) if (getrendermode() >= 3) pus = pub = NUMPAGES; // JBF 20040110: redraw the status bar next time if ((e&128) == 0) { nextpage(); - for (tc = totalclock; totalclock < tc + 4; handleevents(), getpackets() ); + for (tc = totalclock; totalclock < tc + 4; handleevents(), getpackets()); } } @@ -2915,7 +2915,7 @@ void displayrest(long smoothratio) } // this does pain tinting etc from the CON - if ( pp->pals_time >= 0 && pp->loogcnt == 0) // JBF 20040101: pals_time > 0 now >= 0 + if (pp->pals_time >= 0 && pp->loogcnt == 0) // JBF 20040101: pals_time > 0 now >= 0 { fader = pp->pals[0]; fadeg = pp->pals[1]; @@ -2925,7 +2925,7 @@ void displayrest(long smoothratio) dotint = 1; } // reset a normal palette - else if ( restorepalette ) + else if (restorepalette) { //setbrightness(ud.brightness>>2,&pp->palette[0],0); setgamepalette(pp,pp->palette,0); @@ -2959,7 +2959,7 @@ void displayrest(long smoothratio) break; } - if ( KB_KeyPressed(sc_Escape ) ) + if (KB_KeyPressed(sc_Escape)) { KB_ClearKeyDown(sc_Escape); ud.show_help = 0; @@ -2991,24 +2991,24 @@ void displayrest(long smoothratio) if (ud.camerasprite == -1) { - if ( ud.overhead_on != 2 ) + if (ud.overhead_on != 2) { if (pp->newowner >= 0) cameratext(pp->newowner); else { displayweapon(screenpeek); - if (pp->over_shoulder_on == 0 ) + if (pp->over_shoulder_on == 0) displaymasks(screenpeek); } moveclouds(); } - if ( ud.overhead_on > 0 ) + if (ud.overhead_on > 0) { smoothratio = min(max(smoothratio,0),65536); dointerpolations(smoothratio); - if ( ud.scrollmode == 0 ) + if (ud.scrollmode == 0) { if (pp->newowner == -1 && !ud.pause_on) { @@ -3050,7 +3050,7 @@ void displayrest(long smoothratio) clearview(0L); drawmapview(cposx,cposy,pp->zoom,cang); } - drawoverheadmap( cposx,cposy,pp->zoom,cang); + drawoverheadmap(cposx,cposy,pp->zoom,cang); restoreinterpolations(); @@ -3068,11 +3068,11 @@ void displayrest(long smoothratio) coolgaugetext(screenpeek); operatefta(); - if ( KB_KeyPressed(sc_Escape) && ud.overhead_on == 0 + if (KB_KeyPressed(sc_Escape) && ud.overhead_on == 0 && ud.show_help == 0 && ps[myconnectindex].newowner == -1) { - if ( (ps[myconnectindex].gm&MODE_MENU) == MODE_MENU && current_menu < 51) + if ((ps[myconnectindex].gm&MODE_MENU) == MODE_MENU && current_menu < 51) { KB_ClearKeyDown(sc_Escape); ps[myconnectindex].gm &= ~MODE_MENU; @@ -3086,9 +3086,9 @@ void displayrest(long smoothratio) walock[TILE_SAVESHOT] = 199; vscrn(); } - else if ( (ps[myconnectindex].gm&MODE_MENU) != MODE_MENU && - ps[myconnectindex].newowner == -1 && - (ps[myconnectindex].gm&MODE_TYPE) != MODE_TYPE) + else if ((ps[myconnectindex].gm&MODE_MENU) != MODE_MENU && + ps[myconnectindex].newowner == -1 && + (ps[myconnectindex].gm&MODE_TYPE) != MODE_TYPE) { KB_ClearKeyDown(sc_Escape); FX_StopAllSounds(); @@ -3133,7 +3133,7 @@ void displayrest(long smoothratio) else menus(); - if ( ud.pause_on==1 && (ps[myconnectindex].gm&MODE_MENU) == 0 ) + if (ud.pause_on==1 && (ps[myconnectindex].gm&MODE_MENU) == 0) menutext(160,100,0,0,"GAME PAUSED"); if (ud.coords) @@ -3246,7 +3246,7 @@ void drawbackground(void) } y1 = 0; y2 = ydim; - if ( (ready2send && ps[myconnectindex].gm == MODE_GAME) || ud.recstat == 2 ) + if ((ready2send && ps[myconnectindex].gm == MODE_GAME) || ud.recstat == 2) //if (ud.recstat == 0 || ud.recstat == 1 || (ud.recstat == 2 && ud.reccnt > 0)) // JBF 20040717 { if (ud.screen_size == 8) @@ -3305,7 +3305,7 @@ void drawbackground(void) } - if (ud.screen_size > 8 && ( ready2send || ud.recstat == 2 )) + if (ud.screen_size > 8 && (ready2send || ud.recstat == 2)) { y = 0; if (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR) @@ -3389,7 +3389,7 @@ static void SE40_Draw(int spnum,long x,long y,long z,short a,short h,long smooth sprite[j].sectnum==sectnum && sprite[j].picnum==1 && sprite[j].lotag==110 - ) { DrawFloorOverFloor(j); break;} + ) { DrawFloorOverFloor(j); break;} } */ @@ -3397,7 +3397,7 @@ static void SE40_Draw(int spnum,long x,long y,long z,short a,short h,long smooth for (j=headspritestat[15];j>=0;j=nextspritestat[j]) { - if ( sprite[j].picnum==1 && sprite[j].lotag==fofmode && sprite[j].hitag==sprite[floor1].hitag ) + if (sprite[j].picnum==1 && sprite[j].lotag==fofmode && sprite[j].hitag==sprite[floor1].hitag) { floor1=j; fofmode=sprite[j].lotag; @@ -3411,7 +3411,7 @@ static void SE40_Draw(int spnum,long x,long y,long z,short a,short h,long smooth for (j=headspritestat[15];j>=0;j=nextspritestat[j]) { - if ( sprite[j].picnum==1 && sprite[j].lotag==k && sprite[j].hitag==sprite[floor1].hitag ) + if (sprite[j].picnum==1 && sprite[j].lotag==k && sprite[j].hitag==sprite[floor1].hitag) { floor2=j; ok++; break; } @@ -3441,7 +3441,7 @@ static void SE40_Draw(int spnum,long x,long y,long z,short a,short h,long smooth for (j=headspritestat[15];j>=0;j=nextspritestat[j]) // raise ceiling or floor { - if (sprite[j].picnum==1 && sprite[j].lotag==k+2 && sprite[j].hitag==sprite[floor1].hitag ) + if (sprite[j].picnum==1 && sprite[j].lotag==k+2 && sprite[j].hitag==sprite[floor1].hitag) { if (k==40) { @@ -3543,9 +3543,9 @@ void displayrooms(short snum,long smoothratio) } #ifdef POLYMOST - if ( ud.overhead_on == 2 || ud.show_help || (p->cursectnum == -1 && rendmode != 4)) + if (ud.overhead_on == 2 || ud.show_help || (p->cursectnum == -1 && rendmode != 4)) #else - if ( ud.overhead_on == 2 || ud.show_help || p->cursectnum == -1) + if (ud.overhead_on == 2 || ud.show_help || p->cursectnum == -1) #endif return; @@ -3599,7 +3599,7 @@ void displayrooms(short snum,long smoothratio) allocache((long *)&waloff[TILE_SAVESHOT],200*320,&walock[TILE_SAVESHOT]); setviewtotile(TILE_SAVESHOT,200L,320L); } - else if ( getrendermode() == 0 && ( ( ud.screen_tilting && p->rotscrnang ) || ud.detail==0 ) ) + else if (getrendermode() == 0 && ((ud.screen_tilting && p->rotscrnang) || ud.detail==0)) { if (ud.screen_tilting) tang = p->rotscrnang; else tang = 0; @@ -3638,7 +3638,7 @@ void displayrooms(short snum,long smoothratio) p->orotscrnang = p->rotscrnang; // JBF: save it for next time } - if ( (snum == myconnectindex) && (numplayers > 1) ) + if ((snum == myconnectindex) && (numplayers > 1)) { cposx = omyx+mulscale16((long)(myx-omyx),smoothratio); cposy = omyy+mulscale16((long)(myy-omyy),smoothratio); @@ -3668,7 +3668,7 @@ void displayrooms(short snum,long smoothratio) smoothratio = 65536L; } - else if ( p->over_shoulder_on == 0 ) + else if (p->over_shoulder_on == 0) cposz += p->opyoff+mulscale16((long)(p->pyoff-p->opyoff),smoothratio); else view(p,&cposx,&cposy,&cposz,§,cang,choriz); @@ -3687,8 +3687,8 @@ void displayrooms(short snum,long smoothratio) choriz = 100+sprite[p->newowner].shade; else if (p->spritebridge == 0) { - if ( cposz < ( p->truecz + (4<<8) ) ) cposz = cz + (4<<8); - else if ( cposz > ( p->truefz - (4<<8) ) ) cposz = fz - (4<<8); + if (cposz < (p->truecz + (4<<8))) cposz = cz + (4<<8); + else if (cposz > (p->truefz - (4<<8))) cposz = fz - (4<<8); } if (sect >= 0) @@ -3713,7 +3713,7 @@ void displayrooms(short snum,long smoothratio) if (j < dst) dst = j, i = k; } - if ( wall[mirrorwall[i]].overpicnum == MIRROR ) + if (wall[mirrorwall[i]].overpicnum == MIRROR) { preparemirror(cposx,cposy,cposz,cang,choriz,mirrorwall[i],mirrorsector[i],&tposx,&tposy,&tang); @@ -3743,7 +3743,7 @@ void displayrooms(short snum,long smoothratio) screencapt = 0; // walock[TILE_SAVESHOT] = 1; } - else if ( getrendermode() == 0 && ( ( ud.screen_tilting && p->rotscrnang) || ud.detail==0 ) ) + else if (getrendermode() == 0 && ((ud.screen_tilting && p->rotscrnang) || ud.detail==0)) { if (ud.screen_tilting) tang = p->rotscrnang; else tang = 0; @@ -3777,7 +3777,7 @@ short LocateTheLocator(short n,short sn) i = headspritestat[7]; while (i >= 0) { - if ( (sn == -1 || sn == SECT) && n == SLT ) + if ((sn == -1 || sn == SECT) && n == SLT) return i; i = nextspritestat[i]; } @@ -3857,7 +3857,7 @@ short EGS(short whatsect,long s_x,long s_y,long s_z,short s_pn,signed char s_s,s i = insertsprite(whatsect,s_ss); - if ( i < 0 ) + if (i < 0) { dumpdebugdata(); OSD_Printf("Failed spawning sprite with tile %ld from sprite %ld (%ld) at x:%ld,y:%ld,z:%ld,sector:%ld\n",s_pn,s_ow,sprite[s_ow].picnum,s_x,s_y,s_z,whatsect); @@ -3911,7 +3911,7 @@ short EGS(short whatsect,long s_x,long s_y,long s_z,short s_pn,signed char s_s,s actorspriteflags[i] = 0; - if ( actorscrptr[s_pn] ) + if (actorscrptr[s_pn]) { s->extra = *actorscrptr[s_pn]; T5 = *(actorscrptr[s_pn]+1); @@ -4000,7 +4000,7 @@ char wallswitchcheck(short i) return 0; } -short spawn( short j, short pn ) +short spawn(short j, short pn) { short i, s, startwall, endwall, sect, clostest=0; long x, y, d, p; @@ -4039,15 +4039,15 @@ short spawn( short j, short pn ) actorspriteflags[i] = 0; - if ( PN != SPEAKER && PN != LETTER && PN != DUCK && PN != TARGET && PN != TRIPBOMB && PN != VIEWSCREEN && PN != VIEWSCREEN2 && (CS&48) ) - if ( !(PN >= CRACK1 && PN <= CRACK4) ) + if (PN != SPEAKER && PN != LETTER && PN != DUCK && PN != TARGET && PN != TRIPBOMB && PN != VIEWSCREEN && PN != VIEWSCREEN2 && (CS&48)) + if (!(PN >= CRACK1 && PN <= CRACK4)) { if (SS == 127) return i; - if ( wallswitchcheck(i) == 1 && (CS&16) ) + if (wallswitchcheck(i) == 1 && (CS&16)) { - if ( PN != ACCESSSWITCH && PN != ACCESSSWITCH2 && sprite[i].pal) + if (PN != ACCESSSWITCH && PN != ACCESSSWITCH2 && sprite[i].pal) { - if ( (ud.multimode < 2) || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_DMSWITCHES)) ) + if ((ud.multimode < 2) || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_DMSWITCHES))) { sprite[i].xrepeat = sprite[i].yrepeat = 0; sprite[i].cstat = SLT = SHT = 0; @@ -4055,12 +4055,12 @@ short spawn( short j, short pn ) } } CS |= 257; - if ( sprite[i].pal && PN != ACCESSSWITCH && PN != ACCESSSWITCH2) + if (sprite[i].pal && PN != ACCESSSWITCH && PN != ACCESSSWITCH2) sprite[i].pal = 0; return i; } - if ( SHT ) + if (SHT) { changespritestat(i,12); CS |= 257; @@ -4071,14 +4071,14 @@ short spawn( short j, short pn ) s = PN; - if ( CS&1 ) CS |= 256; + if (CS&1) CS |= 256; - if ( actorscrptr[s] ) + if (actorscrptr[s]) { SH = *(actorscrptr[s]); T5 = *(actorscrptr[s]+1); T2 = *(actorscrptr[s]+2); - if ( *(actorscrptr[s]+3) && SHT == 0 ) + if (*(actorscrptr[s]+3) && SHT == 0) SHT = *(actorscrptr[s]+3); } else T2 = T5 = 0; @@ -4103,7 +4103,7 @@ short spawn( short j, short pn ) if (camerashitable) sp->cstat = 257; else sp->cstat = 0; } - if ( ud.multimode < 2 && sp->pal != 0 ) + if (ud.multimode < 2 && sp->pal != 0) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -4120,9 +4120,9 @@ short spawn( short j, short pn ) else switch (dynamictostatic[sp->picnum]) { default: - if ( actorscrptr[sp->picnum] ) + if (actorscrptr[sp->picnum]) { - if ( j == -1 && sp->lotag > ud.player_skill ) + if (j == -1 && sp->lotag > ud.player_skill) { sp->xrepeat=sp->yrepeat=0; changespritestat(i,5); @@ -4133,9 +4133,9 @@ short spawn( short j, short pn ) if (sp->xrepeat == 0 || sp->yrepeat == 0) sp->xrepeat = sp->yrepeat = 1; - if ( actortype[sp->picnum] & 3) + if (actortype[sp->picnum] & 3) { - if ( ud.monsters_off == 1 ) + if (ud.monsters_off == 1) { sp->xrepeat=sp->yrepeat=0; changespritestat(i,5); @@ -4144,7 +4144,7 @@ short spawn( short j, short pn ) makeitfall(i); - if ( actortype[sp->picnum] & 2) + if (actortype[sp->picnum] & 2) hittype[i].actorstayput = sp->sectnum; ps[myconnectindex].max_actors_killed++; @@ -4191,7 +4191,7 @@ short spawn( short j, short pn ) sp->z = getceilzofslope(SECT,SX,SY)+(16<<8); sp->cstat |= 8; } - else if ( sector[sprite[j].sectnum].lotag == 1) + else if (sector[sprite[j].sectnum].lotag == 1) sp->z = getflorzofslope(SECT,SX,SY); } @@ -4259,7 +4259,7 @@ short spawn( short j, short pn ) { sp->xrepeat = 48; sp->yrepeat = 64; - if (sprite[j].statnum == 10 || badguy(&sprite[j]) ) + if (sprite[j].statnum == 10 || badguy(&sprite[j])) sp->z -= (32<<8); } } @@ -4308,7 +4308,7 @@ short spawn( short j, short pn ) break; case FORCESPHERE__STATIC: - if (j == -1 ) + if (j == -1) { sp->cstat = (short) 32768; changespritestat(i,2); @@ -4323,7 +4323,7 @@ short spawn( short j, short pn ) case BLOOD__STATIC: sp->xrepeat = sp->yrepeat = 16; sp->z -= (26<<8); - if ( j >= 0 && sprite[j].pal == 6 ) + if (j >= 0 && sprite[j].pal == 6) sp->pal = 6; changespritestat(i,5); break; @@ -4361,7 +4361,7 @@ short spawn( short j, short pn ) } - if ( sector[SECT].lotag == 1 ) + if (sector[SECT].lotag == 1) { changespritestat(i,5); break; @@ -4369,9 +4369,9 @@ short spawn( short j, short pn ) if (j >= 0 && sp->picnum != PUKE) { - if ( sprite[j].pal == 1) + if (sprite[j].pal == 1) sp->pal = 1; - else if ( sprite[j].pal != 6 && sprite[j].picnum != NUKEBARREL && sprite[j].picnum != TIRE ) + else if (sprite[j].pal != 6 && sprite[j].picnum != NUKEBARREL && sprite[j].picnum != TIRE) { if (sprite[j].picnum == FECES) sp->pal = 7; // Brown @@ -4384,7 +4384,7 @@ short spawn( short j, short pn ) } sp->cstat |= 32; case FECES__STATIC: - if ( j >= 0) + if (j >= 0) sp->xrepeat = sp->yrepeat = 1; changespritestat(i,5); break; @@ -4404,7 +4404,7 @@ short spawn( short j, short pn ) break; case TRIPBOMB__STATIC: - if ( sp->lotag > ud.player_skill ) + if (sp->lotag > ud.player_skill) { sp->xrepeat=sp->yrepeat=0; changespritestat(i,5); @@ -4667,7 +4667,7 @@ short spawn( short j, short pn ) case MONEY__STATIC: case MAIL__STATIC: case PAPER__STATIC: - if ( sp->picnum == MONEY || sp->picnum == MAIL || sp->picnum == PAPER ) + if (sp->picnum == MONEY || sp->picnum == MAIL || sp->picnum == PAPER) { hittype[i].temp_data[0] = TRAND&2047; sp->cstat = TRAND&12; @@ -4687,7 +4687,7 @@ short spawn( short j, short pn ) case SHELL__STATIC: //From the player case SHOTGUNSHELL__STATIC: - if ( j >= 0 ) + if (j >= 0) { short snum,a; @@ -4732,7 +4732,7 @@ short spawn( short j, short pn ) case RESPAWN__STATIC: sp->extra = 66-13; case MUSICANDSFX__STATIC: - if ( ud.multimode < 2 && sp->pal == 1) + if (ud.multimode < 2 && sp->pal == 1) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -4764,12 +4764,12 @@ short spawn( short j, short pn ) sp->shade = -127; sp->cstat |= 128; } - else if (sp->picnum == SHRINKEREXPLOSION ) + else if (sp->picnum == SHRINKEREXPLOSION) { sp->xrepeat = 32; sp->yrepeat = 32; } - else if ( sp->picnum == SMALLSMOKE ) + else if (sp->picnum == SMALLSMOKE) { // 64 "money" sp->xrepeat = 24; @@ -4784,7 +4784,7 @@ short spawn( short j, short pn ) if (j >= 0) { x = getflorzofslope(sp->sectnum,sp->x,sp->y); - if (sp->z > x-(12<<8) ) + if (sp->z > x-(12<<8)) sp->z = x-(12<<8); } @@ -4808,8 +4808,8 @@ short spawn( short j, short pn ) sp->xrepeat = sp->yrepeat = 0; //j = ud.coop; //if(j == 2) j = 0; - j=(gametype_flags[ud.coop] & GAMETYPE_FLAG_COOPSPAWN ) / GAMETYPE_FLAG_COOPSPAWN ; - if ( ud.multimode < 2 || (ud.multimode > 1 && j != sp->lotag) ) + j=(gametype_flags[ud.coop] & GAMETYPE_FLAG_COOPSPAWN) / GAMETYPE_FLAG_COOPSPAWN ; + if (ud.multimode < 2 || (ud.multimode > 1 && j != sp->lotag)) changespritestat(i,5); else changespritestat(i,10); @@ -4817,9 +4817,9 @@ short spawn( short j, short pn ) case WATERBUBBLE__STATIC: if (j >= 0 && sprite[j].picnum == APLAYER) sp->z -= (16<<8); - if ( sp->picnum == WATERBUBBLE) + if (sp->picnum == WATERBUBBLE) { - if ( j >= 0 ) + if (j >= 0) sp->ang = sprite[j].ang; sp->xrepeat = sp->yrepeat = 4; } @@ -4843,7 +4843,7 @@ short spawn( short j, short pn ) s = headspritestat[0]; while (s >= 0) { - if ( sprite[s].picnum == CRANEPOLE && SHT == (sprite[s].hitag) ) + if (sprite[s].picnum == CRANEPOLE && SHT == (sprite[s].hitag)) { msy[tempwallptr+2] = s; @@ -5005,7 +5005,7 @@ short spawn( short j, short pn ) } } - if ( sp->picnum == BOSS4STAYPUT || sp->picnum == BOSS1 || sp->picnum == BOSS2 || sp->picnum == BOSS1STAYPUT || sp->picnum == BOSS3 || sp->picnum == BOSS4 ) + if (sp->picnum == BOSS4STAYPUT || sp->picnum == BOSS1 || sp->picnum == BOSS2 || sp->picnum == BOSS1STAYPUT || sp->picnum == BOSS3 || sp->picnum == BOSS4) { if (j >= 0 && sprite[j].picnum == RESPAWN) sp->pal = sprite[j].pal; @@ -5040,7 +5040,7 @@ short spawn( short j, short pn ) if (j >= 0) sp->lotag = 0; - if ( ( sp->lotag > ud.player_skill ) || ud.monsters_off == 1 ) + if ((sp->lotag > ud.player_skill) || ud.monsters_off == 1) { sp->xrepeat=sp->yrepeat=0; changespritestat(i,5); @@ -5105,7 +5105,7 @@ short spawn( short j, short pn ) if (j >= 0) { - if ( sprite[j].picnum == NUKEBARREL ) + if (sprite[j].picnum == NUKEBARREL) sp->pal = 8; insertspriteq(i); } @@ -5134,7 +5134,7 @@ short spawn( short j, short pn ) if (sp->picnum == RECON) { - if ( sp->lotag > ud.player_skill ) + if (sp->lotag > ud.player_skill) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -5156,7 +5156,7 @@ short spawn( short j, short pn ) CS |= 257; // Make it hitable - if ( ud.multimode < 2 && sp->pal != 0) + if (ud.multimode < 2 && sp->pal != 0) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -5214,7 +5214,7 @@ short spawn( short j, short pn ) sp->cstat = 0; } - if ( ( ud.multimode < 2 && sp->pal != 0) || (sp->lotag > ud.player_skill) ) + if ((ud.multimode < 2 && sp->pal != 0) || (sp->lotag > ud.player_skill)) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -5308,7 +5308,7 @@ short spawn( short j, short pn ) if (sp->lotag != 23) { for (j=0;jz) < klabs(T2-sp->z) ) + if (klabs(T1-sp->z) < klabs(T2-sp->z)) sp->owner = 1; else sp->owner = 0; @@ -5386,7 +5386,7 @@ short spawn( short j, short pn ) else sector[sect].ceilingz = sector[sect].floorz = sp->z; - if ( sector[sect].ceilingstat&1 ) + if (sector[sect].ceilingstat&1) { sector[sect].ceilingstat ^= 1; T4 = 1; @@ -5408,7 +5408,7 @@ short spawn( short j, short pn ) { x = wall[j].nextsector; if (x >= 0) - if ( !(sector[x].ceilingstat&1) ) + if (!(sector[x].ceilingstat&1)) { sector[sect].ceilingpicnum = sector[x].ceilingpicnum; @@ -5461,7 +5461,7 @@ short spawn( short j, short pn ) y = wall[s].y; d = FindDistance2D(sp->x-x,sp->y-y); - if ( d < q ) + if (d < q) { q = d; clostest = s; @@ -5509,7 +5509,7 @@ short spawn( short j, short pn ) { if (!(wall[s].hitag&1)) wall[s].shade=sp->shade; - if ( (wall[s].cstat&2) && wall[s].nextwall >= 0) + if ((wall[s].cstat&2) && wall[s].nextwall >= 0) wall[wall[s].nextwall].shade = sp->shade; } break; @@ -5560,7 +5560,7 @@ short spawn( short j, short pn ) break; case 9: - if ( sector[sect].lotag && + if (sector[sect].lotag && labs(sector[sect].ceilingz-sp->z) > 1024) sector[sect].lotag |= 32768; //If its open case 8: @@ -5595,7 +5595,7 @@ short spawn( short j, short pn ) if (sp->lotag == 0) { - if ( sector[sect].lotag == 30 ) + if (sector[sect].lotag == 30) { if (sp->pal) sprite[i].clipdist = 1; else sprite[i].clipdist = 0; @@ -5605,12 +5605,12 @@ short spawn( short j, short pn ) for (j = 0;j < MAXSPRITES;j++) { - if ( sprite[j].statnum < MAXSTATUS ) - if ( sprite[j].picnum == SECTOREFFECTOR && + if (sprite[j].statnum < MAXSTATUS) + if (sprite[j].picnum == SECTOREFFECTOR && sprite[j].lotag == 1 && sprite[j].hitag == sp->hitag) { - if ( sp->ang == 512 ) + if (sp->ang == 512) { sp->x = sprite[j].x; sp->y = sprite[j].y; @@ -5641,7 +5641,7 @@ short spawn( short j, short pn ) gameexit(tempbuf); } } - if ( sp->lotag == 30 || sp->lotag == 6 || sp->lotag == 14 || sp->lotag == 5 ) + if (sp->lotag == 30 || sp->lotag == 6 || sp->lotag == 14 || sp->lotag == 5) { startwall = sector[sect].wallptr; @@ -5657,9 +5657,9 @@ short spawn( short j, short pn ) for (s=startwall;s= 0 && + if (wall[ s ].nextsector >= 0 && sector[ wall[ s ].nextsector].hitag == 0 && - sector[ wall[ s ].nextsector].lotag < 3 ) + sector[ wall[ s ].nextsector].lotag < 3) { s = wall[s].nextsector; j = 1; @@ -5683,7 +5683,7 @@ short spawn( short j, short pn ) else if (sp->lotag == 16) T4 = sector[sect].ceilingz; - else if ( sp->lotag == 26 ) + else if (sp->lotag == 26) { T4 = sp->x; T5 = sp->y; @@ -5694,7 +5694,7 @@ short spawn( short j, short pn ) sp->shade = 0; } - else if ( sp->lotag == 2) + else if (sp->lotag == 2) { T6 = sector[sp->sectnum].floorheinum; sector[sp->sectnum].floorheinum = 0; @@ -5771,7 +5771,7 @@ short spawn( short j, short pn ) sp->extra = 1; } - if ( ud.multimode < 2 && sp->pal != 0) + if (ud.multimode < 2 && sp->pal != 0) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -5815,7 +5815,7 @@ short spawn( short j, short pn ) sp->owner = j; else sp->owner = i; case EGG__STATIC: - if ( ud.monsters_off == 1 && sp->picnum == EGG ) + if (ud.monsters_off == 1 && sp->picnum == EGG) { sp->xrepeat = sp->yrepeat = 0; changespritestat(i,5); @@ -5841,7 +5841,7 @@ short spawn( short j, short pn ) #ifdef _MSC_VER // Visual C thought this was a bit too hard to optimise so we'd better // tell it not to try... such a pussy it is. -//#pragma auto_inline( off ) +//#pragma auto_inline(off) #pragma optimize("g",off) #endif void animatesprites(long x,long y,short a,long smoothratio) @@ -5925,7 +5925,7 @@ void animatesprites(long x,long y,short a,long smoothratio) //case GREENSLIME+7: // break; default: - if ( ( (t->cstat&16) ) || ( badguy(t) && t->extra > 0) || t->statnum == 10) + if (((t->cstat&16)) || (badguy(t) && t->extra > 0) || t->statnum == 10) continue; } @@ -5944,7 +5944,7 @@ void animatesprites(long x,long y,short a,long smoothratio) } - for (j=0;j < spritesortcnt; j++ ) //Between drawrooms() and drawmasks() + for (j=0;j < spritesortcnt; j++) //Between drawrooms() and drawmasks() { //is the perfect time to animate sprites t = &tsprite[j]; i = t->owner; @@ -6040,15 +6040,15 @@ void animatesprites(long x,long y,short a,long smoothratio) } } - if ( t->statnum == 99 ) continue; - if ( s->statnum != 1 && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0 ) + if (t->statnum == 99) continue; + if (s->statnum != 1 && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0) { t->x -= mulscale16(65536-smoothratio,ps[s->yvel].posx-ps[s->yvel].oposx); t->y -= mulscale16(65536-smoothratio,ps[s->yvel].posy-ps[s->yvel].oposy); t->z = ps[s->yvel].oposz + mulscale16(smoothratio,ps[s->yvel].posz-ps[s->yvel].oposz); t->z += (40<<8); } - else if ( ( s->statnum == 0 && s->picnum != CRANEPOLE) || s->statnum == 10 || s->statnum == 6 || s->statnum == 4 || s->statnum == 5 || s->statnum == 1 ) + else if ((s->statnum == 0 && s->picnum != CRANEPOLE) || s->statnum == 10 || s->statnum == 6 || s->statnum == 4 || s->statnum == 5 || s->statnum == 1) { t->x -= mulscale16(65536-smoothratio,s->x-hittype[i].bposx); t->y -= mulscale16(65536-smoothratio,s->y-hittype[i].bposy); @@ -6105,16 +6105,16 @@ void animatesprites(long x,long y,short a,long smoothratio) sprite[s->owner].x-t->x, sprite[s->owner].y-t->y); - if ( klabs(getincangle(sqa,sqb)) > 512 ) - if ( ldist(&sprite[s->owner],t) < ldist(&sprite[ps[screenpeek].i],&sprite[s->owner]) ) + if (klabs(getincangle(sqa,sqb)) > 512) + if (ldist(&sprite[s->owner],t) < ldist(&sprite[ps[screenpeek].i],&sprite[s->owner])) t->xrepeat = t->yrepeat = 0; } continue; case BURNING__STATIC: case BURNING2__STATIC: - if ( sprite[s->owner].statnum == 10 ) + if (sprite[s->owner].statnum == 10) { - if ( display_mirror == 0 && sprite[s->owner].yvel == screenpeek && ps[sprite[s->owner].yvel].over_shoulder_on == 0 ) + if (display_mirror == 0 && sprite[s->owner].yvel == screenpeek && ps[sprite[s->owner].yvel].over_shoulder_on == 0) t->xrepeat = 0; else { @@ -6147,10 +6147,10 @@ void animatesprites(long x,long y,short a,long smoothratio) break; case SHRINKSPARK__STATIC: - t->picnum = SHRINKSPARK+( (totalclock>>4)&3 ); + t->picnum = SHRINKSPARK+((totalclock>>4)&3); break; case GROWSPARK__STATIC: - t->picnum = GROWSPARK+( (totalclock>>4)&3 ); + t->picnum = GROWSPARK+((totalclock>>4)&3); break; case RPG__STATIC: #if defined(POLYMOST) && defined(USE_OPENGL) @@ -6178,7 +6178,7 @@ void animatesprites(long x,long y,short a,long smoothratio) } #endif k = getangle(s->x-x,s->y-y); - if ( T1 < 4 ) + if (T1 < 4) k = (((s->ang+3072+128-k)&2047)/170); else k = (((s->ang+3072+128-k)&2047)/170); @@ -6189,7 +6189,7 @@ void animatesprites(long x,long y,short a,long smoothratio) } else t->cstat &= ~4; - if ( klabs(t3) > 64 ) k += 7; + if (klabs(t3) > 64) k += 7; t->picnum = RECON+k; break; @@ -6200,10 +6200,10 @@ void animatesprites(long x,long y,short a,long smoothratio) if (t->pal == 1) t->z -= (18<<8); - if (ps[p].over_shoulder_on > 0 && ps[p].newowner < 0 ) + if (ps[p].over_shoulder_on > 0 && ps[p].newowner < 0) { t->cstat |= 2; - if ( screenpeek == myconnectindex && numplayers >= 2 ) + if (screenpeek == myconnectindex && numplayers >= 2) { t->x = omyx+mulscale16((long)(myx-omyx),smoothratio); t->y = omyy+mulscale16((long)(myy-omyy),smoothratio); @@ -6213,13 +6213,13 @@ void animatesprites(long x,long y,short a,long smoothratio) } } - if ( ( display_mirror == 1 || screenpeek != p || s->owner == -1 ) && ud.multimode > 1 && ud.showweapons && sprite[ps[p].i].extra > 0 && ps[p].curr_weapon > 0 ) + if ((display_mirror == 1 || screenpeek != p || s->owner == -1) && ud.multimode > 1 && ud.showweapons && sprite[ps[p].i].extra > 0 && ps[p].curr_weapon > 0) { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); tsprite[spritesortcnt].statnum = 99; - tsprite[spritesortcnt].yrepeat = ( t->yrepeat>>3 ); + tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); if (t->yrepeat < 4) t->yrepeat = 4; tsprite[spritesortcnt].shade = t->shade; @@ -6244,13 +6244,13 @@ void animatesprites(long x,long y,short a,long smoothratio) spritesortcnt++; } - if ( ( display_mirror == 1 || screenpeek != p || s->owner == -1 ) && ud.multimode > 1 && sync[p].svel == 0 && sync[p].fvel == 0 && !ud.pause_on) + if ((display_mirror == 1 || screenpeek != p || s->owner == -1) && ud.multimode > 1 && sync[p].svel == 0 && sync[p].fvel == 0 && !ud.pause_on) { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); tsprite[spritesortcnt].statnum = 99; - tsprite[spritesortcnt].yrepeat = ( t->yrepeat>>3 ); + tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); if (t->yrepeat < 4) t->yrepeat = 4; tsprite[spritesortcnt].cstat = 0; @@ -6285,7 +6285,7 @@ void animatesprites(long x,long y,short a,long smoothratio) } if (sector[t->sectnum].lotag == 2) k += 1795-1405; - else if ( (hittype[i].floorz-s->z) > (64<<8) ) k += 60; + else if ((hittype[i].floorz-s->z) > (64<<8)) k += 60; t->picnum += k; t->pal = ps[p].palookup; @@ -6293,10 +6293,10 @@ void animatesprites(long x,long y,short a,long smoothratio) goto PALONLY; } - if ( ps[p].on_crane == -1 && (sector[s->sectnum].lotag&0x7ff) != 1 ) + if (ps[p].on_crane == -1 && (sector[s->sectnum].lotag&0x7ff) != 1) { l = s->z-hittype[ps[p].i].floorz+(3<<8); - if ( l > 1024 && s->yrepeat > 32 && s->extra > 0 ) + if (l > 1024 && s->yrepeat > 32 && s->extra > 0) s->yoffset = (signed char)(l/(s->yrepeat<<2)); else s->yoffset=0; } @@ -6309,8 +6309,8 @@ void animatesprites(long x,long y,short a,long smoothratio) } if (ud.camerasprite == -1 && ps[p].newowner == -1) - if (s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0 ) - if ( ud.multimode < 2 || ( ud.multimode > 1 && p == screenpeek ) ) + if (s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0) + if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) { t->owner = -1; t->xrepeat = t->yrepeat = 0; @@ -6319,12 +6319,12 @@ void animatesprites(long x,long y,short a,long smoothratio) PALONLY: - if ( sector[sect].floorpal && sector[sect].floorpal < numl) + if (sector[sect].floorpal && sector[sect].floorpal < numl) t->pal = sector[sect].floorpal; if (s->owner == -1) continue; - if ( t->z > hittype[i].floorz && t->xrepeat < 32 ) + if (t->z > hittype[i].floorz && t->xrepeat < 32) t->z = hittype[i].floorz; break; @@ -6360,7 +6360,7 @@ PALONLY: else t->picnum += T1; t->shade -= 6; - if ( sector[sect].floorpal && sector[sect].floorpal < numl ) + if (sector[sect].floorpal && sector[sect].floorpal < numl) t->pal = sector[sect].floorpal; break; @@ -6371,12 +6371,12 @@ PALONLY: break; } default: - if ( sector[sect].floorpal && sector[sect].floorpal < numl ) + if (sector[sect].floorpal && sector[sect].floorpal < numl) t->pal = sector[sect].floorpal; break; } - if ( actorscrptr[s->picnum] ) + if (actorscrptr[s->picnum]) { if (t4) { @@ -6388,7 +6388,7 @@ PALONLY: } else #endif - switch ( l ) + switch (l) { case 2: k = (((s->ang+3072+128-a)&2047)>>8)&1; @@ -6434,50 +6434,50 @@ PALONLY: break; } - t->picnum += k + ( *(long *)t4 ) + l * t3; + t->picnum += k + (*(long *)t4) + l * t3; - if (l > 0) while (tilesizx[t->picnum] == 0 && t->picnum > 0 ) + if (l > 0) while (tilesizx[t->picnum] == 0 && t->picnum > 0) t->picnum -= l; //Hack, for actors - if ( hittype[i].dispicnum >= 0) + if (hittype[i].dispicnum >= 0) hittype[i].dispicnum = t->picnum; } else if (display_mirror == 1) t->cstat |= 4; } - if ( ps[screenpeek].heat_amount > 0 && ps[screenpeek].heat_on && (badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_NVG) || s->picnum == APLAYER || s->statnum == 13)) + if (ps[screenpeek].heat_amount > 0 && ps[screenpeek].heat_on && (badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_NVG) || s->picnum == APLAYER || s->statnum == 13)) { t->pal = 6; t->shade = 0; } - if ( s->statnum == 13 || badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0) ) + if (s->statnum == 13 || badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0)) if (t->statnum != 99 && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE) if (s->picnum != HOTMEAT) { - if ( hittype[i].dispicnum < 0 ) + if (hittype[i].dispicnum < 0) { hittype[i].dispicnum++; continue; } - else if ( ud.shadows && spritesortcnt < (MAXSPRITESONSCREEN-2)) + else if (ud.shadows && spritesortcnt < (MAXSPRITESONSCREEN-2)) { long daz,xrep,yrep; - if ( (sector[sect].lotag&0xff) > 2 || s->statnum == 4 || s->statnum == 5 || s->picnum == DRONE || s->picnum == COMMANDER ) + if ((sector[sect].lotag&0xff) > 2 || s->statnum == 4 || s->statnum == 5 || s->picnum == DRONE || s->picnum == COMMANDER) daz = sector[sect].floorz; else daz = hittype[i].floorz; - if ( (s->z-daz) < (8<<8) ) - if ( ps[screenpeek].posz < daz ) + if ((s->z-daz) < (8<<8)) + if (ps[screenpeek].posz < daz) { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); tsprite[spritesortcnt].statnum = 99; - tsprite[spritesortcnt].yrepeat = ( t->yrepeat>>3 ); + tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); if (t->yrepeat < 4) t->yrepeat = 4; tsprite[spritesortcnt].shade = 127; @@ -6520,7 +6520,7 @@ PALONLY: case LASERLINE__STATIC: if (sector[t->sectnum].lotag == 2) t->pal = 8; t->z = sprite[s->owner].z-(3<<8); - if (lasermode == 2 && ps[screenpeek].heat_on == 0 ) + if (lasermode == 2 && ps[screenpeek].heat_on == 0) t->yrepeat = 0; case EXPLOSION2__STATIC: case EXPLOSION2BOT__STATIC: @@ -6545,7 +6545,7 @@ PALONLY: case FIRE2__STATIC: case BURNING__STATIC: case BURNING2__STATIC: - if ( sprite[s->owner].picnum != TREE1 && sprite[s->owner].picnum != TREE2 ) + if (sprite[s->owner].picnum != TREE1 && sprite[s->owner].picnum != TREE2) t->z = sector[t->sectnum].floorz; t->shade = -127; break; @@ -6600,7 +6600,7 @@ PALONLY: t->owner = -1; break; } - if ( (sprite[s->owner].cstat&32768) == 0 ) + if ((sprite[s->owner].cstat&32768) == 0) { if (!hittype[s->owner].dispicnum) t->picnum = hittype[i].temp_data[1]; @@ -6640,7 +6640,7 @@ PALONLY: } } #ifdef _MSC_VER -//#pragma auto_inline( ) +//#pragma auto_inline() #pragma optimize("",on) #endif @@ -6710,7 +6710,7 @@ void CheatGetInventory(void) { SetGameVarID(g_iReturnVarID, 400, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETSTEROIDS, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].steroids_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6718,7 +6718,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, 1200, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETHEAT, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].heat_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6726,7 +6726,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, 200, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETBOOT, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].boot_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6734,7 +6734,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, 100, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETSHIELD, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].shield_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6742,7 +6742,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, 6400, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETSCUBA, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].scuba_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6750,7 +6750,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, 2400, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETHOLODUKE, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].holoduke_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6758,7 +6758,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, 1600, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETJETPACK, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].jetpack_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6766,7 +6766,7 @@ void CheatGetInventory(void) SetGameVarID(g_iReturnVarID, max_player_health, ps[myconnectindex].i, myconnectindex); OnEvent(EVENT_CHEATGETFIRSTAID, ps[myconnectindex].i, myconnectindex, -1); - if ( GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) + if (GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex) >=0) { ps[myconnectindex].firstaid_amount = GetGameVarID(g_iReturnVarID, ps[myconnectindex].i, myconnectindex); @@ -6787,7 +6787,7 @@ void cheats(void) consolecheat = 1; } - if ( (ps[myconnectindex].gm&MODE_TYPE) || (ps[myconnectindex].gm&MODE_MENU)) + if ((ps[myconnectindex].gm&MODE_TYPE) || (ps[myconnectindex].gm&MODE_MENU)) return; if (VOLUMEONE && !z) { @@ -6799,13 +6799,13 @@ void cheats(void) if (consolecheat && numplayers < 2 && ud.recstat == 0) goto FOUNDCHEAT; - if ( ps[myconnectindex].cheat_phase == 1) + if (ps[myconnectindex].cheat_phase == 1) { while (KB_KeyWaiting()) { ch = Btolower(KB_Getch()); - if ( !( (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') ) ) + if (!((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9'))) { ps[myconnectindex].cheat_phase = 0; // FTA(46,&ps[myconnectindex]); @@ -6826,9 +6826,9 @@ void cheats(void) { for (j = 0;j= '0' && ch <= '9') ) + if (cheatbuf[j] == cheatquotes[k][j] || (cheatquotes[k][j] == '#' && ch >= '0' && ch <= '9')) { - if ( cheatquotes[k][j+1] == 0 ) goto FOUNDCHEAT; + if (cheatquotes[k][j+1] == 0) goto FOUNDCHEAT; if (j == cheatbuflen-1) return; } else break; @@ -6849,9 +6849,9 @@ FOUNDCHEAT: j = 0; } - for ( weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++ ) + for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++) { - addammo( weapon, &ps[myconnectindex], max_ammo_amount[weapon] ); + addammo(weapon, &ps[myconnectindex], max_ammo_amount[weapon]); ps[myconnectindex].gotweapon[weapon] = 1; } @@ -6976,13 +6976,13 @@ FOUNDCHEAT: } CheatGetInventory(); - for ( weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS;weapon++ ) + for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS;weapon++) ps[myconnectindex].gotweapon[weapon] = 1; - for ( weapon = PISTOL_WEAPON; + for (weapon = PISTOL_WEAPON; weapon < (MAX_WEAPONS); - weapon++ ) - addammo( weapon, &ps[myconnectindex], max_ammo_amount[weapon] ); + weapon++) + addammo(weapon, &ps[myconnectindex], max_ammo_amount[weapon]); ps[myconnectindex].got_access = 7; sprite[ps[myconnectindex].i].extra = max_player_health; hittype[ps[myconnectindex].i].extra = 0; @@ -6997,13 +6997,13 @@ FOUNDCHEAT: } else { j = 0; } - for ( weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++ ) + for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++) ps[myconnectindex].gotweapon[weapon] = 1; - for ( weapon = PISTOL_WEAPON; + for (weapon = PISTOL_WEAPON; weapon < (MAX_WEAPONS-j); - weapon++ ) - addammo( weapon, &ps[myconnectindex], max_ammo_amount[weapon] ); + weapon++) + addammo(weapon, &ps[myconnectindex], max_ammo_amount[weapon]); CheatGetInventory(); ps[myconnectindex].got_access = 7; FTA(5,&ps[myconnectindex]); @@ -7034,7 +7034,7 @@ FOUNDCHEAT: volnume--; levnume--; - if ( VOLUMEONE && volnume > 0 ) + if (VOLUMEONE && volnume > 0) { ps[myconnectindex].cheat_phase = 0; KB_FlushKeyBoardQueue(); @@ -7109,7 +7109,7 @@ FOUNDCHEAT: return; case CHEAT_VIEW: - if ( ps[myconnectindex].over_shoulder_on ) + if (ps[myconnectindex].over_shoulder_on) ps[myconnectindex].over_shoulder_on = 0; else { @@ -7136,9 +7136,9 @@ FOUNDCHEAT: { j = sector[i].lotag; if (j == -1 || j == 32767) continue; - if ( (j & 0x7fff) > 2 ) + if ((j & 0x7fff) > 2) { - if ( j&(0xffff-16384) ) + if (j&(0xffff-16384)) sector[i].lotag &= (0xffff-16384); operatesectors(i,ps[myconnectindex].i); } @@ -7237,15 +7237,15 @@ FOUNDCHEAT: } else { - if ( KB_KeyPressed(cheatkey[0]) ) + if (KB_KeyPressed(cheatkey[0])) { - if ( ps[myconnectindex].cheat_phase >= 0 && numplayers < 2 && ud.recstat == 0) + if (ps[myconnectindex].cheat_phase >= 0 && numplayers < 2 && ud.recstat == 0) ps[myconnectindex].cheat_phase = -1; } - if ( KB_KeyPressed(cheatkey[1]) ) + if (KB_KeyPressed(cheatkey[1])) { - if ( ps[myconnectindex].cheat_phase == -1 ) + if (ps[myconnectindex].cheat_phase == -1) { if (ud.player_skill == 4) { @@ -7278,7 +7278,7 @@ void nonsharedkeys(void) if (ud.recstat == 2) { ControlInfo noshareinfo; - CONTROL_GetInput( &noshareinfo ); + CONTROL_GetInput(&noshareinfo); } if (gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex) @@ -7303,18 +7303,18 @@ void nonsharedkeys(void) } } - if ( KB_KeyPressed( sc_F12 ) ) + if (KB_KeyPressed(sc_F12)) { - KB_ClearKeyDown( sc_F12 ); + KB_ClearKeyDown(sc_F12); screencapture("duke0000.tga",0); FTA(103,&ps[myconnectindex]); } - if ( !ALT_IS_PRESSED && ud.overhead_on == 0 && (ps[myconnectindex].gm & MODE_TYPE) == 0) + if (!ALT_IS_PRESSED && ud.overhead_on == 0 && (ps[myconnectindex].gm & MODE_TYPE) == 0) { - if ( BUTTON( gamefunc_Enlarge_Screen ) ) + if (BUTTON(gamefunc_Enlarge_Screen)) { - CONTROL_ClearButton( gamefunc_Enlarge_Screen ); + CONTROL_ClearButton(gamefunc_Enlarge_Screen); if (ud.screen_size > 0) sound(THUD); if (ud.screen_size == 8 && ud.statusbarmode == 0 && bpp > 8 && ud.statusbarscale != 100) @@ -7322,9 +7322,9 @@ void nonsharedkeys(void) else ud.screen_size -= 4; vscrn(); } - if ( BUTTON( gamefunc_Shrink_Screen ) ) + if (BUTTON(gamefunc_Shrink_Screen)) { - CONTROL_ClearButton( gamefunc_Shrink_Screen ); + CONTROL_ClearButton(gamefunc_Shrink_Screen); if (ud.screen_size < 64) sound(THUD); if (ud.screen_size == 4 && ud.statusbarscale == 100 && ud.statusbarmode == 1) ud.statusbarmode = 0; @@ -7335,17 +7335,17 @@ void nonsharedkeys(void) } } - if ( ps[myconnectindex].cheat_phase == 1 || (ps[myconnectindex].gm&(MODE_MENU|MODE_TYPE))) return; + if (ps[myconnectindex].cheat_phase == 1 || (ps[myconnectindex].gm&(MODE_MENU|MODE_TYPE))) return; - if ( BUTTON(gamefunc_See_Coop_View) && ( GTFLAGS(GAMETYPE_FLAG_COOPVIEW) || ud.recstat == 2) ) + if (BUTTON(gamefunc_See_Coop_View) && (GTFLAGS(GAMETYPE_FLAG_COOPVIEW) || ud.recstat == 2)) { - CONTROL_ClearButton( gamefunc_See_Coop_View ); + CONTROL_ClearButton(gamefunc_See_Coop_View); screenpeek = connectpoint2[screenpeek]; if (screenpeek == -1) screenpeek = connecthead; restorepalette = 1; } - if ( ud.multimode > 1 && BUTTON(gamefunc_Show_Opponents_Weapon) ) + if (ud.multimode > 1 && BUTTON(gamefunc_Show_Opponents_Weapon)) { CONTROL_ClearButton(gamefunc_Show_Opponents_Weapon); ud.showweapons = 1-ud.showweapons; @@ -7353,14 +7353,14 @@ void nonsharedkeys(void) FTA(82-ud.showweapons,&ps[screenpeek]); } - if ( BUTTON(gamefunc_Toggle_Crosshair) ) + if (BUTTON(gamefunc_Toggle_Crosshair)) { CONTROL_ClearButton(gamefunc_Toggle_Crosshair); ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1; FTA(ud.crosshair?20:21,&ps[screenpeek]); } - if (ud.overhead_on && BUTTON(gamefunc_Map_Follow_Mode) ) + if (ud.overhead_on && BUTTON(gamefunc_Map_Follow_Mode)) { CONTROL_ClearButton(gamefunc_Map_Follow_Mode); ud.scrollmode = 1-ud.scrollmode; @@ -7373,19 +7373,19 @@ void nonsharedkeys(void) FTA(83+ud.scrollmode,&ps[myconnectindex]); } - if ( SHIFTS_IS_PRESSED || ALT_IS_PRESSED ) + if (SHIFTS_IS_PRESSED || ALT_IS_PRESSED) { i = 0; - if ( KB_KeyPressed( sc_F1) ) { KB_ClearKeyDown(sc_F1);i = 1; } - if ( KB_KeyPressed( sc_F2) ) { KB_ClearKeyDown(sc_F2);i = 2; } - if ( KB_KeyPressed( sc_F3) ) { KB_ClearKeyDown(sc_F3);i = 3; } - if ( KB_KeyPressed( sc_F4) ) { KB_ClearKeyDown(sc_F4);i = 4; } - if ( KB_KeyPressed( sc_F5) ) { KB_ClearKeyDown(sc_F5);i = 5; } - if ( KB_KeyPressed( sc_F6) ) { KB_ClearKeyDown(sc_F6);i = 6; } - if ( KB_KeyPressed( sc_F7) ) { KB_ClearKeyDown(sc_F7);i = 7; } - if ( KB_KeyPressed( sc_F8) ) { KB_ClearKeyDown(sc_F8);i = 8; } - if ( KB_KeyPressed( sc_F9) ) { KB_ClearKeyDown(sc_F9);i = 9; } - if ( KB_KeyPressed( sc_F10) ) {KB_ClearKeyDown(sc_F10);i = 10; } + if (KB_KeyPressed(sc_F1)) { KB_ClearKeyDown(sc_F1);i = 1; } + if (KB_KeyPressed(sc_F2)) { KB_ClearKeyDown(sc_F2);i = 2; } + if (KB_KeyPressed(sc_F3)) { KB_ClearKeyDown(sc_F3);i = 3; } + if (KB_KeyPressed(sc_F4)) { KB_ClearKeyDown(sc_F4);i = 4; } + if (KB_KeyPressed(sc_F5)) { KB_ClearKeyDown(sc_F5);i = 5; } + if (KB_KeyPressed(sc_F6)) { KB_ClearKeyDown(sc_F6);i = 6; } + if (KB_KeyPressed(sc_F7)) { KB_ClearKeyDown(sc_F7);i = 7; } + if (KB_KeyPressed(sc_F8)) { KB_ClearKeyDown(sc_F8);i = 8; } + if (KB_KeyPressed(sc_F9)) { KB_ClearKeyDown(sc_F9);i = 9; } + if (KB_KeyPressed(sc_F10)) {KB_ClearKeyDown(sc_F10);i = 10; } if (i) { @@ -7431,12 +7431,12 @@ void nonsharedkeys(void) } if (ud.lockout == 0) - if (SoundToggle && ALT_IS_PRESSED && ( RTS_NumSounds() > 0 ) && rtsplaying == 0 && VoiceToggle ) + if (SoundToggle && ALT_IS_PRESSED && (RTS_NumSounds() > 0) && rtsplaying == 0 && VoiceToggle) { - rtsptr = (char *)RTS_GetSound (i-1); + rtsptr = (char *)RTS_GetSound(i-1); if (*rtsptr == 'C') - FX_PlayVOC3D( rtsptr,0,0,0,255,-i); - else FX_PlayWAV3D( rtsptr,0,0,0,255,-i); + FX_PlayVOC3D(rtsptr,0,0,0,255,-i); + else FX_PlayWAV3D(rtsptr,0,0,0,255,-i); rtsplaying = 7; @@ -7463,16 +7463,16 @@ void nonsharedkeys(void) if (!ALT_IS_PRESSED && !SHIFTS_IS_PRESSED) { - if ( ud.multimode > 1 && BUTTON(gamefunc_SendMessage) ) + if (ud.multimode > 1 && BUTTON(gamefunc_SendMessage)) { KB_FlushKeyboardQueue(); - CONTROL_ClearButton( gamefunc_SendMessage ); + CONTROL_ClearButton(gamefunc_SendMessage); ps[myconnectindex].gm |= MODE_TYPE; typebuf[0] = 0; inputloc = 0; } - if ( KB_KeyPressed(sc_F1) || ( ud.show_help && ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) ) ) ) + if (KB_KeyPressed(sc_F1) || (ud.show_help && (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter)))) { KB_ClearKeyDown(sc_F1); KB_ClearKeyDown(sc_Space); @@ -7480,7 +7480,7 @@ void nonsharedkeys(void) KB_ClearKeyDown(sc_Enter); ud.show_help ++; - if ( ud.show_help > 2 ) + if (ud.show_help > 2) { ud.show_help = 0; if (ud.multimode < 2 && ud.recstat != 2) ready2send = 1; @@ -7499,9 +7499,9 @@ void nonsharedkeys(void) // if(ud.multimode < 2) { - if (ud.recstat != 2 && KB_KeyPressed( sc_F2 ) ) + if (ud.recstat != 2 && KB_KeyPressed(sc_F2)) { - KB_ClearKeyDown( sc_F2 ); + KB_ClearKeyDown(sc_F2); if (movesperpacket == 4 && connecthead != myconnectindex) return; @@ -7531,9 +7531,9 @@ FAKE_F2: } } - if (KB_KeyPressed( sc_F3 )) + if (KB_KeyPressed(sc_F3)) { - KB_ClearKeyDown( sc_F3 ); + KB_ClearKeyDown(sc_F3); if (movesperpacket == 4 && connecthead != myconnectindex) return; @@ -7553,9 +7553,9 @@ FAKE_F3: } } - if (KB_KeyPressed( sc_F4 ) && FXDevice >= 0 ) + if (KB_KeyPressed(sc_F4) && FXDevice >= 0) { - KB_ClearKeyDown( sc_F4 ); + KB_ClearKeyDown(sc_F4); FX_StopAllSounds(); clearsoundlocks(); @@ -7569,9 +7569,9 @@ FAKE_F3: } - if ( KB_KeyPressed( sc_F6 ) && (ps[myconnectindex].gm&MODE_GAME)) + if (KB_KeyPressed(sc_F6) && (ps[myconnectindex].gm&MODE_GAME)) { - KB_ClearKeyDown( sc_F6 ); + KB_ClearKeyDown(sc_F6); if (movesperpacket == 4 && connecthead != myconnectindex) return; @@ -7589,7 +7589,7 @@ FAKE_F3: displayrooms(myconnectindex,65536); //savetemp("duke3d.tmp",waloff[TILE_SAVESHOT],160*100); screencapt = 0; - if ( lastsavedpos >= 0 ) + if (lastsavedpos >= 0) { /* inputloc = Bstrlen(&ud.savegame[lastsavedpos][0]); current_menu = 360+lastsavedpos; @@ -7600,10 +7600,10 @@ FAKE_F3: } } - if (KB_KeyPressed( sc_F7 ) ) + if (KB_KeyPressed(sc_F7)) { KB_ClearKeyDown(sc_F7); - if ( ps[myconnectindex].over_shoulder_on ) + if (ps[myconnectindex].over_shoulder_on) ps[myconnectindex].over_shoulder_on = 0; else { @@ -7614,17 +7614,17 @@ FAKE_F3: FTA(109+ps[myconnectindex].over_shoulder_on,&ps[myconnectindex]); } - if ( KB_KeyPressed( sc_F5 ) && MusicDevice >= 0 ) + if (KB_KeyPressed(sc_F5) && MusicDevice >= 0) { - KB_ClearKeyDown( sc_F5 ); + KB_ClearKeyDown(sc_F5); Bstrcpy(fta_quotes[26],&music_fn[0][music_select][0]); Bstrcat(fta_quotes[26],". USE SHIFT-F5 TO CHANGE."); FTA(26,&ps[myconnectindex]); } - if (KB_KeyPressed( sc_F8 )) + if (KB_KeyPressed(sc_F8)) { - KB_ClearKeyDown( sc_F8 ); + KB_ClearKeyDown(sc_F8); ud.fta_on = !ud.fta_on; if (ud.fta_on) FTA(23,&ps[myconnectindex]); else @@ -7635,16 +7635,16 @@ FAKE_F3: } } - if (KB_KeyPressed( sc_F9 ) && (ps[myconnectindex].gm&MODE_GAME) ) + if (KB_KeyPressed(sc_F9) && (ps[myconnectindex].gm&MODE_GAME)) { - KB_ClearKeyDown( sc_F9 ); + KB_ClearKeyDown(sc_F9); if (movesperpacket == 4 && myconnectindex != connecthead) return; if (lastsavedpos == -1) goto FAKE_F3; - if ( lastsavedpos >= 0 ) + if (lastsavedpos >= 0) { KB_FlushKeyboardQueue(); KB_ClearKeysDown(); @@ -7664,9 +7664,9 @@ FAKE_F3: } } - if (KB_KeyPressed( sc_F10 )) + if (KB_KeyPressed(sc_F10)) { - KB_ClearKeyDown( sc_F10 ); + KB_ClearKeyDown(sc_F10); cmenu(500); FX_StopAllSounds(); clearsoundlocks(); @@ -7678,33 +7678,33 @@ FAKE_F3: } } - if ( ud.overhead_on != 0) + if (ud.overhead_on != 0) { j = totalclock-nonsharedtimer; nonsharedtimer += j; - if ( BUTTON( gamefunc_Enlarge_Screen ) ) + if (BUTTON(gamefunc_Enlarge_Screen)) ps[myconnectindex].zoom += mulscale6(j,max(ps[myconnectindex].zoom,256)); - if ( BUTTON( gamefunc_Shrink_Screen ) ) + if (BUTTON(gamefunc_Shrink_Screen)) ps[myconnectindex].zoom -= mulscale6(j,max(ps[myconnectindex].zoom,256)); - if ( (ps[myconnectindex].zoom > 2048) ) + if ((ps[myconnectindex].zoom > 2048)) ps[myconnectindex].zoom = 2048; - if ( (ps[myconnectindex].zoom < 48) ) + if ((ps[myconnectindex].zoom < 48)) ps[myconnectindex].zoom = 48; } } - if ( KB_KeyPressed(sc_Escape) && ud.overhead_on && ps[myconnectindex].newowner == -1 ) + if (KB_KeyPressed(sc_Escape) && ud.overhead_on && ps[myconnectindex].newowner == -1) { - KB_ClearKeyDown( sc_Escape ); + KB_ClearKeyDown(sc_Escape); ud.last_overhead = ud.overhead_on; ud.overhead_on = 0; ud.scrollmode = 0; vscrn(); } - if ( BUTTON(gamefunc_AutoRun) ) + if (BUTTON(gamefunc_AutoRun)) { CONTROL_ClearButton(gamefunc_AutoRun); ud.auto_run = 1-ud.auto_run; @@ -7712,10 +7712,10 @@ FAKE_F3: FTA(85+ud.auto_run,&ps[myconnectindex]); } - if ( BUTTON(gamefunc_Map) ) + if (BUTTON(gamefunc_Map)) { - CONTROL_ClearButton( gamefunc_Map ); - if ( ud.last_overhead != ud.overhead_on && ud.last_overhead) + CONTROL_ClearButton(gamefunc_Map); + if (ud.last_overhead != ud.overhead_on && ud.last_overhead) { ud.overhead_on = ud.last_overhead; ud.last_overhead = 0; @@ -7723,27 +7723,27 @@ FAKE_F3: else { ud.overhead_on++; - if (ud.overhead_on == 3 ) ud.overhead_on = 0; + if (ud.overhead_on == 3) ud.overhead_on = 0; ud.last_overhead = ud.overhead_on; } restorepalette = 1; vscrn(); } - if (KB_KeyPressed( sc_F11 )) + if (KB_KeyPressed(sc_F11)) { - KB_ClearKeyDown( sc_F11 ); + KB_ClearKeyDown(sc_F11); if (SHIFTS_IS_PRESSED) ud.brightness-=4; else ud.brightness+=4; - if (ud.brightness > (7<<2) ) + if (ud.brightness > (7<<2)) ud.brightness = 0; else if (ud.brightness < 0) ud.brightness = (7<<2); setbrightness(ud.brightness>>2,&ps[myconnectindex].palette[0],0); - if (ud.brightness < 20) FTA( 29 + (ud.brightness>>2) ,&ps[myconnectindex]); - else if (ud.brightness < 40) FTA( 96 + (ud.brightness>>2) - 5,&ps[myconnectindex]); + if (ud.brightness < 20) FTA(29 + (ud.brightness>>2) ,&ps[myconnectindex]); + else if (ud.brightness < 40) FTA(96 + (ud.brightness>>2) - 5,&ps[myconnectindex]); } } @@ -7881,7 +7881,7 @@ int loadgroupfiles(char *fn) { int j = initgroupfile(fn); - if ( j == -1 ) + if (j == -1) initprintf("Could not find GRP file %s.\n",fn); else initprintf("Using GRP file %s.\n",fn); @@ -8099,7 +8099,7 @@ void checkcommandline(int argc,char **argv) if (firstnet > 0) { if (*c == '-' || *c == '/') { c++; - if (((c[0] == 'n') || (c[0] == 'N')) && (c[1] == '0')) + if (((c[0] == 'n') || (c[0] == 'N')) && (c[1] == '0')) { networkmode = 0; initprintf("Network mode: master/slave\n"); } else if (((c[0] == 'n') || (c[0] == 'N')) && (c[1] == '1')) { networkmode = 1; initprintf("Network mode: peer-to-peer\n"); } @@ -8129,7 +8129,7 @@ void checkcommandline(int argc,char **argv) case 'C': c++; - //if(*c == '1' || *c == '2' || *c == '3' ) + //if(*c == '1' || *c == '2' || *c == '3') // ud.m_coop = *c - '0' - 1; //else ud.m_coop = 0; @@ -8156,7 +8156,7 @@ void checkcommandline(int argc,char **argv) case 'd': case 'D': c++; - if ( strchr(c,'.') == 0) + if (strchr(c,'.') == 0) Bstrcat(c,".dmo"); initprintf("Play demo %s.\n",c); Bstrcpy(firstdemofile,c); @@ -8179,7 +8179,7 @@ void checkcommandline(int argc,char **argv) c++; if (!*c) break; strcpy(tempbuf,c); - if ( strchr(tempbuf,'.') == 0) + if (strchr(tempbuf,'.') == 0) strcat(tempbuf,".grp"); { @@ -8235,7 +8235,7 @@ void checkcommandline(int argc,char **argv) break; case 'm': case 'M': - if ( *(c+1) != 'a' && *(c+1) != 'A' ) + if (*(c+1) != 'a' && *(c+1) != 'A') { ud.m_monsters_off = 1; ud.m_player_skill = ud.player_skill = 0; @@ -8272,7 +8272,7 @@ void checkcommandline(int argc,char **argv) case 'q': case 'Q': initprintf("Fake multiplayer mode.\n"); - if ( *(++c) == 0) ud.multimode = 1; + if (*(++c) == 0) ud.multimode = 1; else ud.multimode = atol(c)%17; ud.m_coop = ud.coop = 0; ud.m_marker = ud.marker = 1; @@ -8445,7 +8445,7 @@ void Logo(void) nextpage(); fadepal(0,0,0, 63,0,-7); totalclock = 0; - while ( totalclock < (120*7) && !KB_KeyWaiting() ) { + while (totalclock < (120*7) && !KB_KeyWaiting()) { handleevents(); getpackets(); } @@ -8471,7 +8471,7 @@ void Logo(void) rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1); if (logoflags & LOGO_FLAG_DUKENUKEM) { - if ( totalclock > 120 && totalclock < (120+60) ) + if (totalclock > 120 && totalclock < (120+60)) { if (soundanm == 0) { @@ -8480,27 +8480,27 @@ void Logo(void) } rotatesprite(160<<16,104<<16,(totalclock-120)<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1); } - else if ( totalclock >= (120+60) ) + else if (totalclock >= (120+60)) rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1); } else soundanm = 1; if (logoflags & LOGO_FLAG_THREEDEE) { - if ( totalclock > 220 && totalclock < (220+30) ) + if (totalclock > 220 && totalclock < (220+30)) { - if ( soundanm == 1) + if (soundanm == 1) { soundanm = 2; sound(PIPEBOMB_EXPLODE); } rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1); - rotatesprite(160<<16,(129)<<16,(totalclock - 220 )<<11,0,THREEDEE,0,0,2+8,0,0,xdim-1,ydim-1); + rotatesprite(160<<16,(129)<<16,(totalclock - 220)<<11,0,THREEDEE,0,0,2+8,0,0,xdim-1,ydim-1); } - else if ( totalclock >= (220+30) ) + else if (totalclock >= (220+30)) rotatesprite(160<<16,(129)<<16,30<<11,0,THREEDEE,0,0,2+8,0,0,xdim-1,ydim-1); } else soundanm = 2; if (PLUTOPAK && (logoflags & LOGO_FLAG_PLUTOPAKSPRITE)) { // JBF 20030804 - if ( totalclock >= 280 && totalclock < 395 ) + if (totalclock >= 280 && totalclock < 395) { rotatesprite(160<<16,(151)<<16,(410-totalclock)<<12,0,PLUTOPAKSPRITE+1,0,0,2+8,0,0,xdim-1,ydim-1); if (soundanm == 2) @@ -8509,7 +8509,7 @@ void Logo(void) sound(FLY_BY); } } - else if ( totalclock >= 395 ) + else if (totalclock >= 395) { if (soundanm == 3) { @@ -8605,7 +8605,7 @@ void freeconmem(void) =================== */ -void Shutdown( void ) +void Shutdown(void) { SoundShutdown(); MusicShutdown(); @@ -8642,7 +8642,7 @@ void compilecons(void) } loadefs(confilename); - if ( loadfromgrouponly ) + if (loadfromgrouponly) { if (userconfiles == 0) { @@ -8657,7 +8657,7 @@ void compilecons(void) loadefs(confilename); } - if ((unsigned long)labelcnt > sizeof(sprite)/64 ) // see the arithmetic above for why + if ((unsigned long)labelcnt > sizeof(sprite)/64) // see the arithmetic above for why gameexit("Error: too many labels defined!"); else { @@ -8672,7 +8672,7 @@ void compilecons(void) gameexit("Error: out of memory retaining labels\n"); } - copybuf(label, newlabel, (labelcnt*64)/4); + copybuf(label, newlabel, (labelcnt*64)/4); copybuf(labelcode, newlabelcode, (labelcnt*sizeof(long))/4); label = newlabel; @@ -8769,7 +8769,7 @@ void Startup(void) if (ud.executions >= 50) initprintf("IT IS NOW TIME TO UPGRADE TO THE COMPLETE VERSION!!!\n"); } - if (CONTROL_Startup( 1, &GetTime, TICRATE )) { + if (CONTROL_Startup(1, &GetTime, TICRATE)) { uninitengine(); exit(1); } @@ -8972,7 +8972,7 @@ void copyprotect(void) #endif if (VOLUMEONE) return; - if ( testcd(IDFILENAME, IDFSIZE) ) + if (testcd(IDFILENAME, IDFSIZE)) { cp = 1; return; @@ -9099,7 +9099,7 @@ void app_main(int argc,char **argv) "textures and skins, but textures will load dramatically " "faster after the first time they are loaded."); if (i) i = 'y'; - if (i == 'y' || i == 'Y' ) + if (i == 'y' || i == 'Y') useprecache = glusetexcompr = glusetexcache = glusetexcachecompression = 1; else glusetexcache = glusetexcachecompression = 0; } @@ -9167,7 +9167,7 @@ void app_main(int argc,char **argv) while (CommandGrps) { s = CommandGrps->next; j = initgroupfile(CommandGrps->str); - if ( j == -1 ) initprintf("Warning: could not find group file %s.\n",CommandGrps->str); + if (j == -1) initprintf("Warning: could not find group file %s.\n",CommandGrps->str); else { groupfile = j; initprintf("Using group file %s.\n",CommandGrps->str); @@ -9197,7 +9197,7 @@ void app_main(int argc,char **argv) if (condebug) initprintf("CON debugging activated (%d).\n\n",condebug); - RegisterShutdownFunction( Shutdown ); + RegisterShutdownFunction(Shutdown); if (VOLUMEONE) { initprintf("Distribution of shareware Duke Nukem 3D is restricted in certain ways.\n"); @@ -9251,7 +9251,7 @@ void app_main(int argc,char **argv) RTS_Init(ud.rtsname); if (numlumps) initprintf("Using .RTS file: %s\n",ud.rtsname); - if ( setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0 ) + if (setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0) { int i = 0; int xres[] = {800,640,320}; @@ -9354,7 +9354,7 @@ MAIN_LOOP_RESTART: } else if(ud.warp_on != 0) vscrn(); */ - if ( ud.warp_on == 0 && playback() ) + if (ud.warp_on == 0 && playback()) { FX_StopAllSounds(); clearsoundlocks(); @@ -9389,7 +9389,7 @@ MAIN_LOOP_RESTART: ud.warp_on = 0; KB_KeyDown[sc_Pause] = 0; // JBF: I hate the pause key - while ( !(ps[myconnectindex].gm&MODE_END) ) //The whole loop!!!!!!!!!!!!!!!!!! + while (!(ps[myconnectindex].gm&MODE_END)) //The whole loop!!!!!!!!!!!!!!!!!! { if (handleevents()) { // JBF if (quitevent) { @@ -9402,13 +9402,13 @@ MAIN_LOOP_RESTART: OSD_DispatchQueued(); - if ( ud.recstat == 2 || ud.multimode > 1 || ( ud.show_help == 0 && (ps[myconnectindex].gm&MODE_MENU) != MODE_MENU ) ) - if ( ps[myconnectindex].gm&MODE_GAME ) - if ( moveloop() ) continue; + if (ud.recstat == 2 || ud.multimode > 1 || (ud.show_help == 0 && (ps[myconnectindex].gm&MODE_MENU) != MODE_MENU)) + if (ps[myconnectindex].gm&MODE_GAME) + if (moveloop()) continue; - if ( ps[myconnectindex].gm&MODE_EOL || ps[myconnectindex].gm&MODE_RESTART ) + if (ps[myconnectindex].gm&MODE_EOL || ps[myconnectindex].gm&MODE_RESTART) { - if ( ps[myconnectindex].gm&MODE_EOL) + if (ps[myconnectindex].gm&MODE_EOL) { closedemowrite(); @@ -9455,7 +9455,7 @@ MAIN_LOOP_RESTART: cheats(); nonsharedkeys(); - if ( (ud.show_help == 0 && ud.multimode < 2 && !(ps[myconnectindex].gm&MODE_MENU) ) || ud.multimode > 1 || ud.recstat == 2) + if ((ud.show_help == 0 && ud.multimode < 2 && !(ps[myconnectindex].gm&MODE_MENU)) || ud.multimode > 1 || ud.recstat == 2) i = min(max((totalclock-ototalclock)*(65536L/TICSPERFRAME),0),65536); else i = 65536; @@ -9472,7 +9472,7 @@ MAIN_LOOP_RESTART: gametext(160,70,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2+8+16); } - // if( KB_KeyPressed(sc_F) ) + // if(KB_KeyPressed(sc_F)) // { // KB_ClearKeyDown(sc_F); // addplayer(); @@ -9486,7 +9486,7 @@ MAIN_LOOP_RESTART: checksync(); if (VOLUMEONE) { - if (ud.show_help == 0 && show_shareware > 0 && (ps[myconnectindex].gm&MODE_MENU) == 0 ) + if (ud.show_help == 0 && show_shareware > 0 && (ps[myconnectindex].gm&MODE_MENU) == 0) rotatesprite((320-50)<<16,9<<16,65536L,0,BETAVERSION,0,0,2+8+16+128,0,0,xdim-1,ydim-1); } @@ -9527,7 +9527,7 @@ char opendemoread(char which_demo) // 0 = mine if (kread(recfilep,&ver,sizeof(char)) != sizeof(char)) goto corrupt; if (ver != BYTEVERSION /*&& ver != 116 && ver != 117*/) { /* old demo playback */ - if (ver == BYTEVERSION_JF) initprintf("Demo %s is for Regular edition.\n", d); + if (ver == BYTEVERSION_JF) initprintf("Demo %s is for Regular edition.\n", d); else if (ver == BYTEVERSION_JF+1) initprintf("Demo %s is for Atomic edition.\n", d); else if (ver == BYTEVERSION_JF+2) initprintf("Demo %s is for Shareware version.\n", d); else OSD_Printf("Demo %s is of an incompatible version (%d).\n", d, ver); @@ -9570,7 +9570,7 @@ char opendemoread(char which_demo) // 0 = mine if (kread(recfilep,(char *)boardfilename,sizeof(boardfilename)) != sizeof(boardfilename)) goto corrupt; } else if (kread(recfilep,(char *)boardfilename,128) != 128) goto corrupt; - if ( boardfilename[0] != 0 ) + if (boardfilename[0] != 0) { ud.m_level_number = 7; ud.m_volume_number = 0; @@ -9700,7 +9700,7 @@ long playback(void) long i,j,k,l; char foundemo; - if ( ready2send ) return 0; + if (ready2send) return 0; foundemo = 0; @@ -9755,7 +9755,7 @@ RECHECK: while (ud.reccnt > 0 || foundemo == 0) { - if (foundemo) while ( totalclock >= (lockclock+TICSPERFRAME) ) + if (foundemo) while (totalclock >= (lockclock+TICSPERFRAME)) { if (demo_version != BYTEVERSION) { @@ -9821,14 +9821,14 @@ RECHECK: displayrooms(screenpeek,j); displayrest(j); - if (ud.multimode > 1 && ps[myconnectindex].gm ) + if (ud.multimode > 1 && ps[myconnectindex].gm) getpackets(); if (gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex) gametext(160,60,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2+8+16); } - if ( (ps[myconnectindex].gm&MODE_MENU) && (ps[myconnectindex].gm&MODE_EOL) ) + if ((ps[myconnectindex].gm&MODE_MENU) && (ps[myconnectindex].gm&MODE_EOL)) goto RECHECK; if (KB_KeyPressed(sc_Escape) && (ps[myconnectindex].gm&MODE_MENU) == 0 && (ps[myconnectindex].gm&MODE_TYPE) == 0) @@ -9851,14 +9851,14 @@ RECHECK: { if (ud.recstat != 2) menus(); - if ( ud.multimode > 1 && current_menu != 20003 && current_menu != 20005 && current_menu != 210) + if (ud.multimode > 1 && current_menu != 20003 && current_menu != 20005 && current_menu != 210) { ControlInfo noshareinfo; - CONTROL_GetInput( &noshareinfo ); - if ( BUTTON(gamefunc_SendMessage) ) + CONTROL_GetInput(&noshareinfo); + if (BUTTON(gamefunc_SendMessage)) { KB_FlushKeyboardQueue(); - CONTROL_ClearButton( gamefunc_SendMessage ); + CONTROL_ClearButton(gamefunc_SendMessage); ps[myconnectindex].gm = MODE_TYPE; typebuf[0] = 0; inputloc = 0; @@ -9875,14 +9875,14 @@ RECHECK: } if (VOLUMEONE) { - if ( ud.show_help == 0 && (ps[myconnectindex].gm&MODE_MENU) == 0 ) + if (ud.show_help == 0 && (ps[myconnectindex].gm&MODE_MENU) == 0) rotatesprite((320-50)<<16,9<<16,65536L,0,BETAVERSION,0,0,2+8+16+128,0,0,xdim-1,ydim-1); } handleevents(); getpackets(); nextpage(); - if ( ps[myconnectindex].gm==MODE_END || ps[myconnectindex].gm==MODE_GAME ) + if (ps[myconnectindex].gm==MODE_END || ps[myconnectindex].gm==MODE_GAME) { if (foundemo) kclose(recfilep); @@ -9924,7 +9924,7 @@ char moveloop() for (i=connecthead;i>=0;i=connectpoint2[i]) if (movefifoplc == movefifoend[i]) break; if (i >= 0) break; - if ( domovethings() ) return 1; + if (domovethings()) return 1; } return 0; } @@ -9985,7 +9985,7 @@ void fakedomovethings(void) shrunk = (sprite[p->i].yrepeat < 32); - if ( ud.clipping == 0 && ( sector[psect].floorpicnum == MIRROR || psect < 0 || psect >= MAXSECTORS) ) + if (ud.clipping == 0 && (sector[psect].floorpicnum == MIRROR || psect < 0 || psect >= MAXSECTORS)) { myx = omyx; myy = omyy; @@ -10005,10 +10005,10 @@ void fakedomovethings(void) j = getflorzofslope(psect,myx,myy); - if ( (lz&49152) == 16384 && psectlotag == 1 && klabs(myz-j) > PHEIGHT+(16<<8) ) + if ((lz&49152) == 16384 && psectlotag == 1 && klabs(myz-j) > PHEIGHT+(16<<8)) psectlotag = 0; - if ( p->aim_mode == 0 && myonground && psectlotag != 2 && (sector[psect].floorstat&2) ) + if (p->aim_mode == 0 && myonground && psectlotag != 2 && (sector[psect].floorstat&2)) { x = myx+(sintable[(myang+512)&2047]>>5); y = myy+(sintable[myang&2047]>>5); @@ -10044,21 +10044,21 @@ void fakedomovethings(void) psectlotag = 0; spritebridge = 1; } - if (badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(sprite[p->i].z-sprite[j].z) < (84<<8) ) + if (badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(sprite[p->i].z-sprite[j].z) < (84<<8)) { - j = getangle( sprite[j].x-myx,sprite[j].y-myy); + j = getangle(sprite[j].x-myx,sprite[j].y-myy); myxvel -= sintable[(j+512)&2047]<<4; myyvel -= sintable[j&2047]<<4; } } - if ( sprite[p->i].extra <= 0 ) + if (sprite[p->i].extra <= 0) { - if ( psectlotag == 2 ) + if (psectlotag == 2) { if (p->on_warping_sector == 0) { - if ( klabs(myz-fz) > (PHEIGHT>>1)) + if (klabs(myz-fz) > (PHEIGHT>>1)) myz += 348; } clipmove(&myx,&myy,&myz,&mycursectnum,0,0,164L,(4L<<8),(4L<<8),CLIPMASK0); @@ -10081,11 +10081,11 @@ void fakedomovethings(void) i = 40; - if ( psectlotag == 2) + if (psectlotag == 2) { myjumpingcounter = 0; - if ( sb_snum&1 ) + if (sb_snum&1) { if (myzvel > 0) myzvel = 0; myzvel -= 348; @@ -10117,10 +10117,10 @@ void fakedomovethings(void) myz += myzvel; - if (myz > (fz-(15<<8)) ) + if (myz > (fz-(15<<8))) myz += ((fz-(15<<8))-myz)>>1; - if (myz < (cz+(4<<8)) ) + if (myz < (cz+(4<<8))) { myz = cz+(4<<8); myzvel = 0; @@ -10144,24 +10144,24 @@ void fakedomovethings(void) if (sb_snum&(1<<1)) //Z myz += j; - if (shrunk == 0 && ( psectlotag == 0 || psectlotag == 2 ) ) k = 32; + if (shrunk == 0 && (psectlotag == 0 || psectlotag == 2)) k = 32; else k = 16; - if (myz > (fz-(k<<8)) ) + if (myz > (fz-(k<<8))) myz += ((fz-(k<<8))-myz)>>1; - if (myz < (cz+(18<<8)) ) + if (myz < (cz+(18<<8))) myz = cz+(18<<8); } - else if ( psectlotag != 2 ) + else if (psectlotag != 2) { if (psectlotag == 1 && p->spritebridge == 0) { if (shrunk == 0) i = 34; else i = 12; } - if (myz < (fz-(i<<8)) && (floorspace(psect)|ceilingspace(psect)) == 0 ) //falling + if (myz < (fz-(i<<8)) && (floorspace(psect)|ceilingspace(psect)) == 0) //falling { - if ( (sb_snum&3) == 0 && myonground && (sector[psect].floorstat&2) && myz >= (fz-(i<<8)-(16<<8) ) ) + if ((sb_snum&3) == 0 && myonground && (sector[psect].floorstat&2) && myz >= (fz-(i<<8)-(16<<8))) myz = fz-(i<<8); else { @@ -10184,7 +10184,7 @@ void fakedomovethings(void) //Smooth on the ground k = ((fz-(i<<8))-myz)>>1; - if ( klabs(k) < 256 ) k = 0; + if (klabs(k) < 256) k = 0; myz += k; // ((fz-(i<<8))-myz)>>1; myzvel -= 768; // 412; if (myzvel < 0) myzvel = 0; @@ -10199,31 +10199,31 @@ void fakedomovethings(void) } } - if ( sb_snum&2 ) + if (sb_snum&2) myz += (2048+768); - if ( (sb_snum&1) == 0 && myjumpingtoggle == 1) + if ((sb_snum&1) == 0 && myjumpingtoggle == 1) myjumpingtoggle = 0; - else if ( (sb_snum&1) && myjumpingtoggle == 0 ) + else if ((sb_snum&1) && myjumpingtoggle == 0) { - if ( myjumpingcounter == 0 ) - if ( (fz-cz) > (56<<8) ) + if (myjumpingcounter == 0) + if ((fz-cz) > (56<<8)) { myjumpingcounter = 1; myjumpingtoggle = 1; } } - if ( myjumpingcounter && (sb_snum&1) == 0 ) + if (myjumpingcounter && (sb_snum&1) == 0) myjumpingcounter = 0; } if (myjumpingcounter) { - if ( (sb_snum&1) == 0 && myjumpingtoggle == 1) + if ((sb_snum&1) == 0 && myjumpingtoggle == 1) myjumpingtoggle = 0; - if ( myjumpingcounter < (1024+256) ) + if (myjumpingcounter < (1024+256)) { if (psectlotag == 1 && myjumpingcounter > 768) { @@ -10247,7 +10247,7 @@ void fakedomovethings(void) myz += myzvel; - if (myz < (cz+(4<<8)) ) + if (myz < (cz+(4<<8))) { myjumpingcounter = 0; if (myzvel < 0) myxvel = myyvel = 0; @@ -10257,20 +10257,20 @@ void fakedomovethings(void) } - if ( p->fist_incs || + if (p->fist_incs || p->transporter_hold > 2 || myhardlanding || p->access_incs > 0 || p->knee_incs > 0 || (p->curr_weapon == TRIPBOMB_WEAPON && p->kickback_pic > 1 && - p->kickback_pic < 4 ) ) + p->kickback_pic < 4)) { doubvel = 0; myxvel = 0; myyvel = 0; } - else if ( syn->avel ) //p->ang += syncangvel * constant + else if (syn->avel) //p->ang += syncangvel * constant { //ENGINE calculates angvel for you long tempang; @@ -10282,7 +10282,7 @@ void fakedomovethings(void) myang &= 2047; } - if ( myxvel || myyvel || syn->fvel || syn->svel ) + if (myxvel || myyvel || syn->fvel || syn->svel) { if (p->jetpack_on == 0 && p->steroids_amount > 0 && p->steroids_amount < 400) doubvel <<= 1; @@ -10290,7 +10290,7 @@ void fakedomovethings(void) myxvel += ((syn->fvel*doubvel)<<6); myyvel += ((syn->svel*doubvel)<<6); - if ( ( p->curr_weapon == KNEE_WEAPON && p->kickback_pic > 10 && myonground ) || ( myonground && (sb_snum&2) ) ) + if ((p->curr_weapon == KNEE_WEAPON && p->kickback_pic > 10 && myonground) || (myonground && (sb_snum&2))) { myxvel = mulscale16(myxvel,p->runspeed-0x2000); myyvel = mulscale16(myyvel,p->runspeed-0x2000); @@ -10309,10 +10309,10 @@ void fakedomovethings(void) } } - if ( abs(myxvel) < 2048 && abs(myyvel) < 2048 ) + if (abs(myxvel) < 2048 && abs(myyvel) < 2048) myxvel = myyvel = 0; - if ( shrunk ) + if (shrunk) { myxvel = mulscale16(myxvel,(p->runspeed)-(p->runspeed>>1)+(p->runspeed>>2)); @@ -10327,7 +10327,7 @@ FAKEHORIZONLY: clipmove(&myx,&myy,&myz,&mycursectnum,myxvel,myyvel,164L,4L<<8,i,CLIPMASK0); pushmove(&myx,&myy,&myz,&mycursectnum,164L,4L<<8,4L<<8,CLIPMASK0); - if ( p->jetpack_on == 0 && psectlotag != 1 && psectlotag != 2 && shrunk) + if (p->jetpack_on == 0 && psectlotag != 1 && psectlotag != 2 && shrunk) myz += 30<<8; if ((sb_snum&(1<<18)) || myhardlanding) @@ -10367,8 +10367,8 @@ FAKEHORIZONLY: myhoriz += syn->horz; else { - if ( myhoriz > 95 && myhoriz < 105) myhoriz = 100; - if ( myhorizoff > -5 && myhorizoff < 5) myhorizoff = 0; + if (myhoriz > 95 && myhoriz < 105) myhoriz = 100; + if (myhorizoff > -5 && myhorizoff < 5) myhorizoff = 0; } if (myhardlanding > 0) @@ -10408,16 +10408,16 @@ char domovethings(void) long p; for (i=connecthead;i>=0;i=connectpoint2[i]) - if ( sync[i].bits&(1<<17) ) + if (sync[i].bits&(1<<17)) { multiflag = 2; multiwhat = (sync[i].bits>>18)&1; - multipos = (unsigned) (sync[i].bits>>19)&15; + multipos = (unsigned)(sync[i].bits>>19)&15; multiwho = i; - if ( multiwhat ) + if (multiwhat) { - saveplayer( multipos ); + saveplayer(multipos); multiflag = 0; if (multiwho != myconnectindex) @@ -10436,7 +10436,7 @@ char domovethings(void) { // waitforeverybody(); - j = loadplayer( multipos ); + j = loadplayer(multipos); multiflag = 0; @@ -10501,7 +10501,7 @@ char domovethings(void) } } - if ( show_shareware > 0 ) + if (show_shareware > 0) { show_shareware--; if (show_shareware == 0) @@ -10562,8 +10562,8 @@ char domovethings(void) ps[myconnectindex].ftq = 116, ps[myconnectindex].fta = 180; - if (j < 0 && networkmode == 0 ) - gameexit( "The server/master player just quit the game; disconnected."); + if (j < 0 && networkmode == 0) + gameexit("The server/master player just quit the game; disconnected."); } if ((numplayers >= 2) && ((movefifoplc&7) == 7)) @@ -10577,7 +10577,7 @@ char domovethings(void) if (ud.recstat == 1) record(); - if ( ud.pause_on == 0 ) + if (ud.pause_on == 0) { global_random = TRAND; movedummyplayers();//ST 13 @@ -10613,14 +10613,14 @@ char domovethings(void) cheatkeys(i); - if ( ud.pause_on == 0 ) + if (ud.pause_on == 0) { processinput(i); checksectors(i); } } - if ( ud.pause_on == 0 ) + if (ud.pause_on == 0) { movefta(); //ST 2 @@ -10653,7 +10653,7 @@ char domovethings(void) fakedomovethingscorrect(); - if ( (everyothertime&1) == 0) + if ((everyothertime&1) == 0) { animatewalls(); movecyclers(); @@ -10678,25 +10678,25 @@ void doorders(void) KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,ORDERING,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); fadepal(0,0,0, 63,0,-7); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } fadepal(0,0,0, 0,63,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,ORDERING+1,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); fadepal(0,0,0, 63,0,-7); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } fadepal(0,0,0, 0,63,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,ORDERING+2,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); fadepal(0,0,0, 63,0,-7); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } fadepal(0,0,0, 0,63,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,ORDERING+3,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); fadepal(0,0,0, 63,0,-7); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } } @@ -10766,21 +10766,21 @@ void dobonus(char bonusonly) KB_FlushKeyboardQueue(); totalclock = 0; tinc = 0; - while ( 1 ) + while (1) { clearview(0L); rotatesprite(0,50<<16,65536L,0,VICTORY1,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); // boss - if ( totalclock > 390 && totalclock < 780 ) - for (t=0;t<35;t+=5) if ( bossmove[t+2] && (totalclock%390) > bossmove[t] && (totalclock%390) <= bossmove[t+1] ) + if (totalclock > 390 && totalclock < 780) + for (t=0;t<35;t+=5) if (bossmove[t+2] && (totalclock%390) > bossmove[t] && (totalclock%390) <= bossmove[t+1]) { if (t==10 && bonuscnt == 1) { sound(SHOTGUN_FIRE);sound(SQUISHED); bonuscnt++; } rotatesprite(bossmove[t+3]<<16,bossmove[t+4]<<16,65536L,0,bossmove[t+2],0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); } // Breathe - if ( totalclock < 450 || totalclock >= 750 ) + if (totalclock < 450 || totalclock >= 750) { if (totalclock >= 750) { @@ -10790,7 +10790,7 @@ void dobonus(char bonusonly) } for (t=0;t<20;t+=5) - if ( breathe[t+2] && (totalclock%120) > breathe[t] && (totalclock%120) <= breathe[t+1] ) + if (breathe[t+2] && (totalclock%120) > breathe[t] && (totalclock%120) <= breathe[t+1]) { if (t==5 && bonuscnt == 0) { @@ -10803,7 +10803,7 @@ void dobonus(char bonusonly) handleevents(); getpackets(); nextpage(); - if ( KB_KeyWaiting() ) break; + if (KB_KeyWaiting()) break; } } @@ -10815,7 +10815,7 @@ void dobonus(char bonusonly) rotatesprite(0,0,65536L,0,3292,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-1); else nextpage(); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } fadepal(0,0,0, 0,64,1); MUSIC_StopSong(); FX_StopAllSounds(); @@ -10843,7 +10843,7 @@ void dobonus(char bonusonly) setgamepalette(&ps[myconnectindex], palette, 3); // JBF 20040308 rotatesprite(0,0,65536L,0,3293,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-1); else nextpage(); - while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); } + while (!KB_KeyWaiting()) { handleevents(); getpackets(); } IFISSOFTMODE fadepal(0,0,0, 0,64,1); break; @@ -10930,7 +10930,7 @@ void dobonus(char bonusonly) playanm("RADLOGO.ANM",3); - if ( ud.lockout == 0 && !KB_KeyWaiting() ) + if (ud.lockout == 0 && !KB_KeyWaiting()) { sound(ENDSEQVOL3SND5); while (issoundplaying(-1,ENDSEQVOL3SND5)) { handleevents(); getpackets(); } @@ -11059,9 +11059,9 @@ FRAGBONUS: KB_FlushKeyboardQueue(); while (KB_KeyWaiting()==0) { handleevents(); getpackets(); } - if ( KB_KeyPressed( sc_F12 ) ) + if (KB_KeyPressed(sc_F12)) { - KB_ClearKeyDown( sc_F12 ); + KB_ClearKeyDown(sc_F12); screencapture("duke0000.tga",0); } @@ -11125,7 +11125,7 @@ FRAGBONUS: } - while ( 1 ) + while (1) { int yy = 0, zz; @@ -11136,9 +11136,9 @@ FRAGBONUS: { rotatesprite(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); - if ( totalclock > (1000000000L) && totalclock < (1000000320L) ) + if (totalclock > (1000000000L) && totalclock < (1000000320L)) { - switch ( (totalclock>>4)%15 ) + switch ((totalclock>>4)%15) { case 0: if (bonuscnt == 6) @@ -11172,10 +11172,10 @@ FRAGBONUS: break; } } - else if ( totalclock > (10240+120L) ) break; + else if (totalclock > (10240+120L)) break; else { - switch ( (totalclock>>5)&3 ) + switch ((totalclock>>5)&3) { case 1: case 3: @@ -11192,7 +11192,7 @@ FRAGBONUS: gametext(160,192,"PRESS ANY KEY TO CONTINUE",16,2+8+16); - if ( totalclock > (60*3) ) + if (totalclock > (60*3)) { yy = zz = 59; gametext(10,yy+9,"Your Time:",0,2+8+16); yy+=10; @@ -11208,7 +11208,7 @@ FRAGBONUS: bonuscnt++; yy = zz; - if ( totalclock > (60*4) ) + if (totalclock > (60*4)) { if (bonuscnt == 1) { @@ -11248,7 +11248,7 @@ FRAGBONUS: } zz = yy += 5; - if ( totalclock > (60*6) ) + if (totalclock > (60*6)) { gametext(10,yy+9,"Enemies Killed:",0,2+8+16); yy += 10; gametext(10,yy+9,"Enemies Left:",0,2+8+16); yy += 10; @@ -11261,7 +11261,7 @@ FRAGBONUS: yy = zz; - if ( totalclock > (60*7) ) + if (totalclock > (60*7)) { if (bonuscnt == 3) { @@ -11270,14 +11270,14 @@ FRAGBONUS: } sprintf(tempbuf,"%-3ld",ps[myconnectindex].actors_killed); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; - if (ud.player_skill > 3 ) + if (ud.player_skill > 3) { sprintf(tempbuf,"N/A"); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; } else { - if ( (ps[myconnectindex].max_actors_killed-ps[myconnectindex].actors_killed) < 0 ) + if ((ps[myconnectindex].max_actors_killed-ps[myconnectindex].actors_killed) < 0) sprintf(tempbuf,"%-3d",0); else sprintf(tempbuf,"%-3ld",ps[myconnectindex].max_actors_killed-ps[myconnectindex].actors_killed); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; @@ -11286,14 +11286,14 @@ FRAGBONUS: } zz = yy += 5; - if ( totalclock > (60*9) ) + if (totalclock > (60*9)) { gametext(10,yy+9,"Secrets Found:",0,2+8+16); yy += 10; gametext(10,yy+9,"Secrets Missed:",0,2+8+16); yy += 10; if (bonuscnt == 4) bonuscnt++; yy = zz; - if ( totalclock > (60*10) ) + if (totalclock > (60*10)) { if (bonuscnt == 5) { @@ -11302,7 +11302,7 @@ FRAGBONUS: } sprintf(tempbuf,"%-3ld",ps[myconnectindex].secret_rooms); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; - if ( ps[myconnectindex].secret_rooms > 0 ) + if (ps[myconnectindex].secret_rooms > 0) sprintf(tempbuf,"%-3ld%%",(100*ps[myconnectindex].secret_rooms/ps[myconnectindex].max_secret_rooms)); sprintf(tempbuf,"%-3ld",ps[myconnectindex].max_secret_rooms-ps[myconnectindex].secret_rooms); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; @@ -11312,21 +11312,21 @@ FRAGBONUS: if (totalclock > 10240 && totalclock < 10240+10240) totalclock = 1024; - if ( ( (MOUSE_GetButtons()&7) || KB_KeyWaiting() ) && totalclock > (60*2) ) // JBF 20030809 + if (((MOUSE_GetButtons()&7) || KB_KeyWaiting()) && totalclock > (60*2)) // JBF 20030809 { MOUSE_ClearButton(7); - if ( KB_KeyPressed( sc_F12 ) ) + if (KB_KeyPressed(sc_F12)) { - KB_ClearKeyDown( sc_F12 ); + KB_ClearKeyDown(sc_F12); screencapture("duke0000.tga",0); } - if ( totalclock < (60*13) ) + if (totalclock < (60*13)) { KB_FlushKeyboardQueue(); totalclock = (60*13); } - else if ( totalclock < (1000000000L)) + else if (totalclock < (1000000000L)) totalclock = (1000000000L); } } @@ -11365,9 +11365,9 @@ void vglass(long x,long y,short a,short wn,short n) sect = wall[wn].nextsector; if (sect == -1) return; - zincs = ( sector[sect].floorz-sector[sect].ceilingz ) / n; + zincs = (sector[sect].floorz-sector[sect].ceilingz) / n; - for (z = sector[sect].ceilingz;z < sector[sect].floorz; z += zincs ) + for (z = sector[sect].ceilingz;z < sector[sect].floorz; z += zincs) EGS(sect,x,y,z-(TRAND&8191),GLASSPIECES+(z&(TRAND%3)),-32,36,36,a+128-(TRAND&255),16+(TRAND&31),0,-1,5); } @@ -11411,7 +11411,7 @@ void lotsofglass(short i,short wallnum,short n) if (sect >= 0) { z = sector[sect].floorz-(TRAND&(klabs(sector[sect].ceilingz-sector[sect].floorz))); - if ( z < -(32<<8) || z > (32<<8) ) + if (z < -(32<<8) || z > (32<<8)) z = SZ-(32<<8)+(TRAND&((64<<8)-1)); a = SA-1024; EGS(SECT,x1,y1,z,GLASSPIECES+(j%3),-32,36,36,a,32+(TRAND&63),-(TRAND&1023),i,5); @@ -11490,7 +11490,7 @@ void lotsofcolourglass(short i,short wallnum,short n) updatesector(x1,y1,§); z = sector[sect].floorz-(TRAND&(klabs(sector[sect].ceilingz-sector[sect].floorz))); - if ( z < -(32<<8) || z > (32<<8) ) + if (z < -(32<<8) || z > (32<<8)) z = SZ-(32<<8)+(TRAND&((64<<8)-1)); a = SA-1024; k = EGS(SECT,x1,y1,z,GLASSPIECES+(j%3),-32,36,36,a,32+(TRAND&63),-(TRAND&2047),i,5); @@ -11498,7 +11498,7 @@ void lotsofcolourglass(short i,short wallnum,short n) } } -void SetupGameButtons( void ) +void SetupGameButtons(void) { CONTROL_DefineFlag(gamefunc_Move_Forward,false); CONTROL_DefineFlag(gamefunc_Move_Backward,false); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 76936482a..f3d1a44fa 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -868,7 +868,7 @@ void skipcomments(void) { if (!(error || warning) && condebug > 1) initprintf("%s:%ld: debug: got comment.\n",compilefile,line_number); - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; } else if (c == '/' && textptr[1] == '*') @@ -1093,7 +1093,7 @@ int ReadGameVars(long fil) { if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERPLAYER) aGameVars[i].plValues=Bcalloc(MAXPLAYERS,sizeof(long)); - else if ( aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR) + else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR) aGameVars[i].plValues=Bcalloc(MAXSPRITES,sizeof(long)); else // else nothing 'extra...' @@ -1114,7 +1114,7 @@ int ReadGameVars(long fil) //AddLog(g_szBuf); if (kdfread(aGameVars[i].plValues,sizeof(long) * MAXPLAYERS, 1, fil) != 1) goto corrupt; } - else if ( aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR) + else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR) { //Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(long) * MAXSPRITES); //AddLog(g_szBuf); @@ -1182,7 +1182,7 @@ void SaveGameVars(FILE *fil) //AddLog(g_szBuf); dfwrite(aGameVars[i].plValues,sizeof(long) * MAXPLAYERS, 1, fil); } - else if ( aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR) + else if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PERACTOR) { //Bsprintf(g_szBuf,"Writing value array for %s (%d)",aGameVars[i].szLabel,sizeof(long) * MAXSPRITES); //AddLog(g_szBuf); @@ -1221,7 +1221,7 @@ void DumpGameVars(FILE *fp) fprintf(fp,"// Current Game Definitions\n\n"); for (i=0;i (MAXVARLABEL-1) ) + if (Bstrlen(pszLabel) > (MAXVARLABEL-1)) { error++; initprintf("%s:%ld: error: variable name `%s' exceeds limit of %d characters.\n",compilefile,line_number,pszLabel, MAXVARLABEL); @@ -1288,7 +1288,7 @@ char AddGameVar(char *pszLabel, long lValue, unsigned long dwFlags) { if (aGameVars[i].szLabel != NULL) { - if ( Bstrcmp(pszLabel,aGameVars[i].szLabel) == 0 ) + if (Bstrcmp(pszLabel,aGameVars[i].szLabel) == 0) { // found it... if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PLONG) @@ -1317,7 +1317,7 @@ char AddGameVar(char *pszLabel, long lValue, unsigned long dwFlags) } } } - if ( i < MAXGAMEVARS) + if (i < MAXGAMEVARS) { // Set values if (aGameVars[i].dwFlags & GAMEVAR_FLAG_SYSTEM) @@ -1365,7 +1365,7 @@ char AddGameVar(char *pszLabel, long lValue, unsigned long dwFlags) for (j=0;j=0 && sPlayer < MAXPLAYERS) { - //Bsprintf(g_szBuf,"GetGameVarID( %d, %d, %d) returns %ld\n",id,sActor,sPlayer, aGameVars[id].plValues[sPlayer]); + //Bsprintf(g_szBuf,"GetGameVarID(%d, %d, %d) returns %ld\n",id,sActor,sPlayer, aGameVars[id].plValues[sPlayer]); //AddLog(g_szBuf); if (m) return -aGameVars[id].plValues[sPlayer]; else return aGameVars[id].plValues[sPlayer]; @@ -1448,7 +1448,7 @@ long GetGameVarID(int id, short sActor, short sPlayer) else return aGameVars[id].lValue; } } - else if ( aGameVars[id].dwFlags & GAMEVAR_FLAG_PERACTOR ) + else if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PERACTOR) { // for the current actor if (sActor >= 0 && sActor <=MAXSPRITES) @@ -1462,10 +1462,10 @@ long GetGameVarID(int id, short sActor, short sPlayer) else return aGameVars[id].lValue; } } - else if ( aGameVars[id].dwFlags & GAMEVAR_FLAG_PLONG ) + else if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PLONG) { if (m) return -(*((long*)aGameVars[id].lValue)); - else return (*((long*)aGameVars[id].lValue)); + else return(*((long*)aGameVars[id].lValue)); } else { @@ -1493,7 +1493,7 @@ void SetGameVarID(int id, long lValue, short sActor, short sPlayer) // for the current actor aGameVars[id].plValues[sActor]=lValue; } - else if ( aGameVars[id].dwFlags & GAMEVAR_FLAG_PLONG ) + else if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PLONG) { // set the value at pointer *((long*)aGameVars[id].lValue)=lValue; @@ -1511,7 +1511,7 @@ long GetGameVar(char *szGameLabel, long lDefault, short sActor, short sPlayer) { if (aGameVars[i].szLabel != NULL) { - if ( Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0 ) + if (Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0) { return GetGameVarID(i, sActor, sPlayer); } @@ -1527,7 +1527,7 @@ long *GetGameValuePtr(char *szGameLabel) { if (aGameVars[i].szLabel != NULL) { - if ( Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0 ) + if (Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0) { if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PERACTOR | GAMEVAR_FLAG_PERPLAYER)) { @@ -1553,7 +1553,7 @@ long GetDefID(char *szGameLabel) { if (aGameVars[i].szLabel != NULL) { - if ( Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0 ) + if (Bstrcmp(szGameLabel, aGameVars[i].szLabel) == 0) { return i; } @@ -1578,7 +1578,7 @@ char ispecial(char c) char isaltok(char c) { - return ( isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.'); + return (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.'); } long getlabelid(LABELS *pLabel, char *psz) @@ -1623,16 +1623,16 @@ void getlabel(void) skipcomments(); - while ( isalnum(*textptr) == 0 ) + while (isalnum(*textptr) == 0) { if (*textptr == 0x0a) line_number++; textptr++; - if ( *textptr == 0) + if (*textptr == 0) return; } i = 0; - while ( ispecial(*textptr) == 0 && *textptr!=']' && *textptr!='\t' && *textptr!='\n' && *textptr!='\r') + while (ispecial(*textptr) == 0 && *textptr!=']' && *textptr!='\t' && *textptr!='\n' && *textptr!='\r') label[(labelcnt<<6)+i++] = *(textptr++); label[(labelcnt<<6)+i] = 0; @@ -1649,22 +1649,22 @@ long keyword(void) temptextptr = textptr; - while ( isaltok(*temptextptr) == 0 ) + while (isaltok(*temptextptr) == 0) { temptextptr++; - if ( *temptextptr == 0 ) + if (*temptextptr == 0) return 0; } i = 0; - while ( isaltok(*temptextptr) ) + while (isaltok(*temptextptr)) { tempbuf[i] = *(temptextptr++); i++; } tempbuf[i] = 0; for (i=0;i 63 || ( *textptr == '\0' ) || ( *(textptr+1) == '\0' ) ) return 1; + if ((error+warning) > 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) return 1; if (condebug) ReportError(-1); - if (checking_switch > 0 ) + if (checking_switch > 0) { //Bsprintf(g_szBuf,"PC(): '%.25s'",textptr); //AddLog(g_szBuf); @@ -1995,7 +1995,7 @@ char parsecommand(void) case -1: return 0; //End case CON_STATE: - if ( parsing_actor == 0 && parsing_state == 0 ) + if (parsing_actor == 0 && parsing_state == 0) { getlabel(); scriptptr--; @@ -2011,7 +2011,7 @@ char parsecommand(void) getlabel(); for (i=0;i 0 ) + if (num_braces > 0) { ReportError(ERROR_OPENBRACKET); error++; } - if ( num_braces < 0 ) + if (num_braces < 0) { ReportError(ERROR_CLOSEBRACKET); error++; } - if ( checking_switch > 0 ) + if (checking_switch > 0) { ReportError(ERROR_NOENDSWITCH); error++; @@ -2129,7 +2129,7 @@ char parsecommand(void) lLabelID=getlabeloffset(projectilelabels,label+(labelcnt<<6)); //printf("LabelID is %ld\n",lLabelID); - if (lLabelID == -1 ) + if (lLabelID == -1) { error++; ReportError(ERROR_SYMBOLNOTRECOGNIZED); @@ -2179,7 +2179,7 @@ char parsecommand(void) // Check to see it's already defined for (i=0;i MAXVOLUMES-1) { initprintf("%s:%ld: error: volume number exceeds maximum volume count.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0) textptr++; break; } i = 0; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { volume_names[j][i] = toupper(*textptr); textptr++,i++; @@ -4365,7 +4365,7 @@ repeatcase: { initprintf("%s:%ld: error: volume name exceeds limit of %ld characters.\n",compilefile,line_number,sizeof(volume_names[j])-1); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } } @@ -4378,19 +4378,19 @@ repeatcase: transnum(LABEL_DEFINE); scriptptr--; j = *scriptptr; - while ( *textptr == ' ' || *textptr == '\t' ) textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; if (j < 0 || j > NUMGAMEFUNCTIONS-1) { initprintf("%s:%ld: error: function number exceeds number of game functions.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0) textptr++; break; } i = 0; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { gamefunctions[j][i] = *textptr; keydefaults[j*3][i] = *textptr; @@ -4399,7 +4399,7 @@ repeatcase: { initprintf("%s:%ld: error: function name exceeds limit of %ld characters.\n",compilefile,line_number,MAXGAMEFUNCLEN); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } } @@ -4412,19 +4412,19 @@ repeatcase: transnum(LABEL_DEFINE); scriptptr--; j = *scriptptr; - while ( *textptr == ' ' || *textptr == '\t' ) textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; if (j < 0 || j > 4) { initprintf("%s:%ld: error: skill number exceeds maximum skill count.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0) textptr++; break; } i = 0; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { skill_names[j][i] = toupper(*textptr); textptr++,i++; @@ -4432,7 +4432,7 @@ repeatcase: { initprintf("%s:%ld: error: skill name exceeds limit of %ld characters.\n",compilefile,line_number,sizeof(skill_names[j])-1); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } } @@ -4449,20 +4449,20 @@ repeatcase: scriptptr--; //remove it from compiled code gametype_flags[j] = *scriptptr; //put it into the flags - while ( *textptr == ' ' || *textptr == '\t' ) textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; if (j < 0 || j > MAXGAMETYPES-1) { initprintf("%s:%ld: error: gametype number exceeds maximum gametype count.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0) textptr++; break; } num_gametypes = j+1; i = 0; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { gametype_names[j][i] = toupper(*textptr); textptr++,i++; @@ -4470,7 +4470,7 @@ repeatcase: { initprintf("%s:%ld: error: gametype name exceeds limit of %ld characters.\n",compilefile,line_number,sizeof(gametype_names[j])-1); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } } @@ -4485,13 +4485,13 @@ repeatcase: transnum(LABEL_DEFINE); scriptptr--; k = *scriptptr; - while ( *textptr == ' ' || *textptr == '\t' ) textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; if (j < 0 || j > MAXVOLUMES-1) { initprintf("%s:%ld: error: volume number exceeds maximum volume count.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0) textptr++; break; } if (k < 0 || k > 10) @@ -4499,12 +4499,12 @@ repeatcase: initprintf("%s:%ld: error: level number exceeds maximum number of levels per episode.\n", line_number,compilefile); error++; - while ( *textptr != 0x0a && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0) textptr++; break; } i = 0; - while ( *textptr != ' ' && *textptr != '\t' && *textptr != 0x0a ) + while (*textptr != ' ' && *textptr != '\t' && *textptr != 0x0a) { level_file_names[j*11+k][i] = *textptr; textptr++,i++; @@ -4512,31 +4512,31 @@ repeatcase: { initprintf("%s:%ld: error: level file name exceeds limit of %d characters.\n",compilefile,line_number,BMAX_PATH); error++; - while ( *textptr != ' ' && *textptr != '\t') textptr++; + while (*textptr != ' ' && *textptr != '\t') textptr++; break; } } level_names[j*11+k][i] = '\0'; - while ( *textptr == ' ' || *textptr == '\t' ) textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; partime[j*11+k] = (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); textptr += 5; - while ( *textptr == ' ' || *textptr == '\t') textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; designertime[j*11+k] = (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); textptr += 5; - while ( *textptr == ' ' || *textptr == '\t') textptr++; + while (*textptr == ' ' || *textptr == '\t') textptr++; i = 0; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { level_names[j*11+k][i] = toupper(*textptr); textptr++,i++; @@ -4544,7 +4544,7 @@ repeatcase: { initprintf("%s:%ld: error: level name exceeds limit of %ld characters.\n",compilefile,line_number,sizeof(level_names[j*11+k])-1); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } } @@ -4580,7 +4580,7 @@ repeatcase: i = 0; - while ( *textptr == ' ' || *textptr == '\t' ) + while (*textptr == ' ' || *textptr == '\t') textptr++; if (tw == CON_REDEFINEQUOTE) @@ -4595,13 +4595,13 @@ repeatcase: } } - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { if (*textptr == '%' && *(textptr+1) == 's') { initprintf("%s:%ld: error: quote text contains string identifier.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } if (tw == CON_DEFINEQUOTE) @@ -4613,7 +4613,7 @@ repeatcase: { initprintf("%s:%ld: error: quote text exceeds limit of %ld characters.\n",compilefile,line_number,MAXQUOTELEN-1); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } } @@ -4644,14 +4644,14 @@ repeatcase: { initprintf("%s:%ld: error: cheat redefinition attempts to redefine nonexistant cheat.\n",compilefile,line_number); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; break; } scriptptr--; i = 0; - while ( *textptr == ' ' || *textptr == '\t' ) + while (*textptr == ' ' || *textptr == '\t') textptr++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 && *textptr != ' ') + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0 && *textptr != ' ') { cheatquotes[k][i] = *textptr; textptr++,i++; @@ -4659,7 +4659,7 @@ repeatcase: { initprintf("%s:%ld: error: cheat exceeds limit of %ld characters.\n",compilefile,line_number,MAXCHEATLEN,sizeof(cheatquotes[k])-1); error++; - while ( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 && *textptr != ' ') textptr++; + while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0 && *textptr != ' ') textptr++; break; } } @@ -4679,7 +4679,7 @@ repeatcase: i = 0; skipcomments(); - while ( *textptr != ' ' || *textptr == '\t' ) + while (*textptr != ' ' || *textptr == '\t') { sounds[k][i] = *textptr; textptr++,i++; @@ -4712,18 +4712,18 @@ repeatcase: case CON_ENDEVENT: - if ( parsing_event == 0) + if (parsing_event == 0) { ReportError(-1); initprintf("%s:%ld: error: found `endevent' without open `onevent'.\n",compilefile,line_number); error++; } - if ( num_braces > 0 ) + if (num_braces > 0) { ReportError(ERROR_OPENBRACKET); error++; } - if ( num_braces < 0 ) + if (num_braces < 0) { ReportError(ERROR_CLOSEBRACKET); error++; @@ -4735,18 +4735,18 @@ repeatcase: return 0; case CON_ENDA: - if ( parsing_actor == 0 ) + if (parsing_actor == 0) { ReportError(-1); initprintf("%s:%ld: error: found `enda' without open `actor'.\n",compilefile,line_number); error++; } - if ( num_braces > 0 ) + if (num_braces > 0) { ReportError(ERROR_OPENBRACKET); error++; } - if ( num_braces < 0 ) + if (num_braces < 0) { ReportError(ERROR_CLOSEBRACKET); error++; @@ -4889,10 +4889,10 @@ void passone(void) int i; #endif - while ( parsecommand() == 0 ); + while (parsecommand() == 0); - if ( (error+warning) > 63) - initprintf( "fatal error: too many warnings or errors: Aborted\n"); + if ((error+warning) > 63) + initprintf("fatal error: too many warnings or errors: Aborted\n"); #ifdef DEBUG initprintf("Game Definitions\n"); @@ -4919,7 +4919,7 @@ void copydefaultcons(void) for (i=0;i= MAXGAMEEVENTS) + if (iEventID >= MAXGAMEEVENTS) { AddLog("Invalid Event ID"); return; } - if ( apScriptGameEvent[iEventID] == 0 ) + if (apScriptGameEvent[iEventID] == 0) { //Bsprintf(g_szBuf,"No event found for %d",iEventID); //AddLog(g_szBuf); @@ -3056,12 +3056,12 @@ void OnEvent(int iEventID, short sActor,short sPlayer,long lDist) killit_flag = 0; do done = parse(); - while ( done == 0 ); + while (done == 0); if (killit_flag == 1) { // if player was set to squish, first stop that... - if (g_p >= 0 ) + if (g_p >= 0) { if (ps[g_p].actorsqu == g_i) ps[g_p].actorsqu = -1; @@ -3092,7 +3092,7 @@ char dodge(spritetype *s) for (i=headspritestat[4];i>=0;i=nextspritestat[i]) //weapons list { - if ( OW == i || SECT != s->sectnum) + if (OW == i || SECT != s->sectnum) continue; bx = SX-mx; @@ -3123,7 +3123,7 @@ short furthestangle(short sActor,short angs) angincs = 2048/angs; if (s->picnum != APLAYER) - if ( (g_t[0]&63) > 2 ) return( s->ang + 1024 ); + if ((g_t[0]&63) > 2) return(s->ang + 1024); for (j=s->ang;j<(2048+s->ang);j+=angincs) { @@ -3149,7 +3149,7 @@ short furthestcanseepoint(short sActor,spritetype *ts,long *dax,long *day) long hx, hy, hz, d, da;//, d, cd, ca,tempx,tempy,cx,cy; spritetype *s = &sprite[sActor]; - if ( (g_t[0]&63) ) return -1; + if ((g_t[0]&63)) return -1; if (ud.multimode < 2 && ud.player_skill < 3) angincs = 2048/2; @@ -3165,7 +3165,7 @@ short furthestcanseepoint(short sActor,spritetype *ts,long *dax,long *day) d = klabs(hx-ts->x)+klabs(hy-ts->y); da = klabs(hx-s->x)+klabs(hy-s->y); - if ( d < da ) + if (d < da) if (cansee(hx,hy,hz,hitsect,s->x,s->y,s->z-(16<<8),s->sectnum)) { *dax = hx; @@ -3182,7 +3182,7 @@ void getglobalz(short sActor) spritetype *s = &sprite[sActor]; - if ( s->statnum == 10 || s->statnum == 6 || s->statnum == 2 || s->statnum == 1 || s->statnum == 4) + if (s->statnum == 10 || s->statnum == 6 || s->statnum == 2 || s->statnum == 1 || s->statnum == 4) { if (s->statnum == 4) zr = 4L; @@ -3190,19 +3190,19 @@ void getglobalz(short sActor) getzrange(s->x,s->y,s->z-(FOURSLEIGHT),s->sectnum,&hittype[sActor].ceilingz,&hz,&hittype[sActor].floorz,&lz,zr,CLIPMASK0); - if ( (lz&49152) == 49152 && (sprite[lz&(MAXSPRITES-1)].cstat&48) == 0 ) + if ((lz&49152) == 49152 && (sprite[lz&(MAXSPRITES-1)].cstat&48) == 0) { lz &= (MAXSPRITES-1); - if ( badguy(&sprite[lz]) && sprite[lz].pal != 1) + if (badguy(&sprite[lz]) && sprite[lz].pal != 1) { - if ( s->statnum != 4 ) + if (s->statnum != 4) { hittype[sActor].dispicnum = -4; // No shadows on actors s->xvel = -256; ssp(sActor,CLIPMASK0); } } - else if (sprite[lz].picnum == APLAYER && badguy(s) ) + else if (sprite[lz].picnum == APLAYER && badguy(s)) { hittype[sActor].dispicnum = -4; // No shadows on actors s->xvel = -256; @@ -3228,16 +3228,16 @@ void makeitfall(short sActor) spritetype *s = &sprite[sActor]; long hz,lz,c; - if ( floorspace(s->sectnum) ) + if (floorspace(s->sectnum)) c = 0; else { - if ( ceilingspace(s->sectnum) || sector[s->sectnum].lotag == 2) + if (ceilingspace(s->sectnum) || sector[s->sectnum].lotag == 2) c = gc/6; else c = gc; } - if ( ( s->statnum == 1 || s->statnum == 10 || s->statnum == 2 || s->statnum == 6 ) ) + if ((s->statnum == 1 || s->statnum == 10 || s->statnum == 2 || s->statnum == 6)) getzrange(s->x,s->y,s->z-(FOURSLEIGHT),s->sectnum,&hittype[sActor].ceilingz,&hz,&hittype[sActor].floorz,&lz,127L,CLIPMASK0); else { @@ -3245,16 +3245,16 @@ void makeitfall(short sActor) hittype[sActor].floorz = sector[s->sectnum].floorz; } - if ( s->z < hittype[sActor].floorz-(FOURSLEIGHT) ) + if (s->z < hittype[sActor].floorz-(FOURSLEIGHT)) { - if ( sector[s->sectnum].lotag == 2 && s->zvel > 3122 ) + if (sector[s->sectnum].lotag == 2 && s->zvel > 3122) s->zvel = 3144; if (s->zvel < 6144) s->zvel += c; else s->zvel = 6144; s->z += s->zvel; } - if ( s->z >= hittype[sActor].floorz-(FOURSLEIGHT) ) + if (s->z >= hittype[sActor].floorz-(FOURSLEIGHT)) { s->z = hittype[sActor].floorz - FOURSLEIGHT; s->zvel = 0; @@ -3299,7 +3299,7 @@ void alterang(short a) // NOTE: looks like 'owner' is set to target sprite ID... - if (j >= 0 && cansee(sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum,g_sp->x,g_sp->y,g_sp->z,g_sp->sectnum) ) + if (j >= 0 && cansee(sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum,g_sp->x,g_sp->y,g_sp->z,g_sp->sectnum)) g_sp->owner = j; else g_sp->owner = ps[g_p].i; @@ -3314,11 +3314,11 @@ void alterang(short a) if (ticselapsed < 2) { - if ( klabs(angdif) < 256) + if (klabs(angdif) < 256) { j = 128-(TRAND&256); g_sp->ang += j; - if ( hits(g_i) < 844 ) + if (hits(g_i) < 844) g_sp->ang -= j; } } @@ -3372,7 +3372,7 @@ void move() } if (a&spin) - g_sp->ang += sintable[ ((g_t[0]<<3)&2047) ]>>6; + g_sp->ang += sintable[((g_t[0]<<3)&2047)]>>6; if (a&face_player_slow) { @@ -3406,9 +3406,9 @@ void move() g_sp->ang += angdif; } - if ( g_t[1] == 0 || a == 0 ) + if (g_t[1] == 0 || a == 0) { - if ( ( badguy(g_sp) && g_sp->extra <= 0 ) || (hittype[g_i].bposx != g_sp->x) || (hittype[g_i].bposy != g_sp->y) ) + if ((badguy(g_sp) && g_sp->extra <= 0) || (hittype[g_i].bposx != g_sp->x) || (hittype[g_i].bposy != g_sp->y)) { hittype[g_i].bposx = g_sp->x; hittype[g_i].bposy = g_sp->y; @@ -3428,7 +3428,7 @@ void move() if (g_sp->picnum != APLAYER) alterang(a); - if (g_sp->xvel > -6 && g_sp->xvel < 6 ) g_sp->xvel = 0; + if (g_sp->xvel > -6 && g_sp->xvel < 6) g_sp->xvel = 0; a = badguy(g_sp); @@ -3436,19 +3436,19 @@ void move() { if (a && g_sp->picnum != ROTATEGUN) { - if ( (g_sp->picnum == DRONE || g_sp->picnum == COMMANDER) && g_sp->extra > 0) + if ((g_sp->picnum == DRONE || g_sp->picnum == COMMANDER) && g_sp->extra > 0) { if (g_sp->picnum == COMMANDER) { hittype[g_i].floorz = l = getflorzofslope(g_sp->sectnum,g_sp->x,g_sp->y); - if ( g_sp->z > (l-(8<<8)) ) + if (g_sp->z > (l-(8<<8))) { - if ( g_sp->z > (l-(8<<8)) ) g_sp->z = l-(8<<8); + if (g_sp->z > (l-(8<<8))) g_sp->z = l-(8<<8); g_sp->zvel = 0; } hittype[g_i].ceilingz = l = getceilzofslope(g_sp->sectnum,g_sp->x,g_sp->y); - if ( (g_sp->z-l) < (80<<8) ) + if ((g_sp->z-l) < (80<<8)) { g_sp->z = l+(80<<8); g_sp->zvel = 0; @@ -3456,16 +3456,16 @@ void move() } else { - if ( g_sp->zvel > 0 ) + if (g_sp->zvel > 0) { hittype[g_i].floorz = l = getflorzofslope(g_sp->sectnum,g_sp->x,g_sp->y); - if ( g_sp->z > (l-(30<<8)) ) + if (g_sp->z > (l-(30<<8))) g_sp->z = l-(30<<8); } else { hittype[g_i].ceilingz = l = getceilzofslope(g_sp->sectnum,g_sp->x,g_sp->y); - if ( (g_sp->z-l) < (50<<8) ) + if ((g_sp->z-l) < (50<<8)) { g_sp->z = l+(50<<8); g_sp->zvel = 0; @@ -3477,10 +3477,10 @@ void move() { if (g_sp->zvel > 0 && hittype[g_i].floorz < g_sp->z) g_sp->z = hittype[g_i].floorz; - if ( g_sp->zvel < 0) + if (g_sp->zvel < 0) { l = getceilzofslope(g_sp->sectnum,g_sp->x,g_sp->y); - if ( (g_sp->z-l) < (66<<8) ) + if ((g_sp->z-l) < (66<<8)) { g_sp->z = l+(66<<8); g_sp->zvel >>= 1; @@ -3489,15 +3489,15 @@ void move() } } else if (g_sp->picnum == APLAYER) - if ( (g_sp->z-hittype[g_i].ceilingz) < (32<<8) ) + if ((g_sp->z-hittype[g_i].ceilingz) < (32<<8)) g_sp->z = hittype[g_i].ceilingz+(32<<8); daxvel = g_sp->xvel; angdif = g_sp->ang; - if ( a && g_sp->picnum != ROTATEGUN ) + if (a && g_sp->picnum != ROTATEGUN) { - if ( g_x < 960 && g_sp->xrepeat > 16 ) + if (g_x < 960 && g_sp->xrepeat > 16) { daxvel = -(1024-g_x); @@ -3516,14 +3516,14 @@ void move() } else if (g_sp->picnum != DRONE && g_sp->picnum != SHARK && g_sp->picnum != COMMANDER) { - if ( hittype[g_i].bposz != g_sp->z || ( ud.multimode < 2 && ud.player_skill < 2 ) ) + if (hittype[g_i].bposz != g_sp->z || (ud.multimode < 2 && ud.player_skill < 2)) { - if ( (g_t[0]&1) || ps[g_p].actorsqu == g_i ) return; + if ((g_t[0]&1) || ps[g_p].actorsqu == g_i) return; else daxvel <<= 1; } else { - if ( (g_t[0]&3) || ps[g_p].actorsqu == g_i ) return; + if ((g_t[0]&3) || ps[g_p].actorsqu == g_i) return; else daxvel <<= 2; } } @@ -3534,13 +3534,13 @@ void move() (daxvel*(sintable[angdif&2047]))>>14,g_sp->zvel,CLIPMASK0); } - if ( a ) + if (a) { if (sector[g_sp->sectnum].ceilingstat&1) g_sp->shade += (sector[g_sp->sectnum].ceilingshade-g_sp->shade)>>1; else g_sp->shade += (sector[g_sp->sectnum].floorshade-g_sp->shade)>>1; - if ( sector[g_sp->sectnum].floorpicnum == MIRROR ) + if (sector[g_sp->sectnum].floorpicnum == MIRROR) deletesprite(g_i); } } @@ -3549,7 +3549,7 @@ char parse(void); void parseifelse(long condition) { - if ( condition ) + if (condition) { // skip 'else' pointer.. and... insptr+=2; @@ -3620,7 +3620,7 @@ char parse(void) case CON_IFRND: insptr++; - parseifelse( rnd(*insptr)); + parseifelse(rnd(*insptr)); break; case CON_IFCANSHOOTTARGET: @@ -3629,7 +3629,7 @@ char parse(void) { short temphit, sclip, angdif; - if ( badguy(g_sp) && g_sp->xrepeat > 56 ) + if (badguy(g_sp) && g_sp->xrepeat > 56) { sclip = 3084; angdif = 48; @@ -3660,7 +3660,7 @@ char parse(void) else { g_sp->ang -= angdif;j = hitasprite(g_i,&temphit);g_sp->ang += angdif; - if ( j > 768 ) + if (j > 768) { if (temphit >= 0 && sprite[temphit].picnum == g_sp->picnum) j = 0; @@ -3682,7 +3682,7 @@ char parse(void) case CON_IFCANSEETARGET: j = cansee(g_sp->x,g_sp->y,g_sp->z-((TRAND&41)<<8),g_sp->sectnum,ps[g_p].posx,ps[g_p].posy,ps[g_p].posz/*-((TRAND&41)<<8)*/,sprite[ps[g_p].i].sectnum); parseifelse(j); - if ( j ) hittype[g_i].timetosleep = SLEEPTIME; + if (j) hittype[g_i].timetosleep = SLEEPTIME; break; case CON_IFACTORNOTSTAYPUT: @@ -3721,12 +3721,12 @@ char parse(void) // Huh?. This does nothing.... // (the result is always j==0....) - if ( ( klabs(hittype[g_i].lastvx-g_sp->x)+klabs(hittype[g_i].lastvy-g_sp->y) ) < - ( klabs(hittype[g_i].lastvx-s->x)+klabs(hittype[g_i].lastvy-s->y) ) ) + if ((klabs(hittype[g_i].lastvx-g_sp->x)+klabs(hittype[g_i].lastvy-g_sp->y)) < + (klabs(hittype[g_i].lastvx-s->x)+klabs(hittype[g_i].lastvy-s->y))) j = 0; // um yeah, this if() will always fire.... - if ( j == 0 ) + if (j == 0) { // search around for target player @@ -3746,7 +3746,7 @@ char parse(void) hittype[g_i].lastvy = s->y; } - if ( j == 1 && ( g_sp->statnum == 1 || g_sp->statnum == 6 ) ) + if (j == 1 && (g_sp->statnum == 1 || g_sp->statnum == 6)) hittype[g_i].timetosleep = SLEEPTIME; parseifelse(j == 1); @@ -3758,7 +3758,7 @@ char parse(void) break; case CON_IFSQUISHED: - parseifelse( ifsquished(g_i, g_p) == 1); + parseifelse(ifsquished(g_i, g_p) == 1); break; case CON_IFDEAD: @@ -3824,7 +3824,7 @@ char parse(void) if (*insptr == 0) { for (j=0;j < ps[g_p].weapreccnt;j++) - if ( ps[g_p].weaprecs[j] == g_sp->picnum ) + if (ps[g_p].weaprecs[j] == g_sp->picnum) break; parseifelse(j < ps[g_p].weapreccnt && g_sp->owner == g_i); @@ -3864,7 +3864,7 @@ char parse(void) case CON_PKICK: insptr++; - if ( ud.multimode > 1 && g_sp->picnum == APLAYER ) + if (ud.multimode > 1 && g_sp->picnum == APLAYER) { if (ps[otherp].quick_kick == 0) ps[otherp].quick_kick = 14; @@ -3879,10 +3879,10 @@ char parse(void) j = (*insptr++-g_sp->xrepeat)<<1; g_sp->xrepeat += ksgn(j); - if ( ( g_sp->picnum == APLAYER && g_sp->yrepeat < 36 ) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat*(tilesizy[g_sp->picnum]+8))<<2) < (hittype[g_i].floorz - hittype[g_i].ceilingz) ) + if ((g_sp->picnum == APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat*(tilesizy[g_sp->picnum]+8))<<2) < (hittype[g_i].floorz - hittype[g_i].ceilingz)) { j = ((*insptr)-g_sp->yrepeat)<<1; - if ( klabs(j) ) g_sp->yrepeat += ksgn(j); + if (klabs(j)) g_sp->yrepeat += ksgn(j); } insptr++; @@ -3908,7 +3908,7 @@ char parse(void) case CON_IFSOUND: insptr++; - parseifelse( isspritemakingsound(g_i,*insptr) ); + parseifelse(isspritemakingsound(g_i,*insptr)); // parseifelse(SoundOwner[*insptr][0].i == g_i); break; @@ -3944,23 +3944,23 @@ char parse(void) { long c; - if ( floorspace(g_sp->sectnum) ) + if (floorspace(g_sp->sectnum)) c = 0; else { - if ( ceilingspace(g_sp->sectnum) || sector[g_sp->sectnum].lotag == 2) + if (ceilingspace(g_sp->sectnum) || sector[g_sp->sectnum].lotag == 2) c = gc/6; else c = gc; } - if ( hittype[g_i].cgg <= 0 || (sector[g_sp->sectnum].floorstat&2) ) + if (hittype[g_i].cgg <= 0 || (sector[g_sp->sectnum].floorstat&2)) { getglobalz(g_i); hittype[g_i].cgg = 6; } else hittype[g_i].cgg --; - if ( g_sp->z < (hittype[g_i].floorz-FOURSLEIGHT) ) + if (g_sp->z < (hittype[g_i].floorz-FOURSLEIGHT)) { g_sp->zvel += c; g_sp->z+=g_sp->zvel; @@ -3971,10 +3971,10 @@ char parse(void) { g_sp->z = hittype[g_i].floorz - FOURSLEIGHT; - if ( badguy(g_sp) || ( g_sp->picnum == APLAYER && g_sp->owner >= 0) ) + if (badguy(g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0)) { - if ( g_sp->zvel > 3084 && g_sp->extra <= 1) + if (g_sp->zvel > 3084 && g_sp->extra <= 1) { if (g_sp->pal != 1 && g_sp->picnum != DRONE) { @@ -4028,16 +4028,16 @@ SKIPJIBS: return 1; case CON_ADDAMMO: insptr++; - if ( ps[g_p].ammo_amount[*insptr] >= max_ammo_amount[*insptr] ) + if (ps[g_p].ammo_amount[*insptr] >= max_ammo_amount[*insptr]) { killit_flag = 2; break; } - addammo( *insptr, &ps[g_p], *(insptr+1) ); + addammo(*insptr, &ps[g_p], *(insptr+1)); if (ps[g_p].curr_weapon == KNEE_WEAPON) - if ( ps[g_p].gotweapon[*insptr]) { + if (ps[g_p].gotweapon[*insptr]) { if (!(ps[g_p].weaponswitch & 1)) addweaponnoswitch(&ps[g_p], *insptr); - else addweapon( &ps[g_p], *insptr ); + else addweapon(&ps[g_p], *insptr); } insptr += 2; break; @@ -4080,20 +4080,20 @@ SKIPJIBS: case CON_ADDWEAPON: insptr++; - if ( ps[g_p].gotweapon[*insptr] == 0 ) { + if (ps[g_p].gotweapon[*insptr] == 0) { if (!(ps[g_p].weaponswitch & 1)) addweaponnoswitch(&ps[g_p], *insptr); - else addweapon( &ps[g_p], *insptr ); + else addweapon(&ps[g_p], *insptr); } - else if ( ps[g_p].ammo_amount[*insptr] >= max_ammo_amount[*insptr] ) + else if (ps[g_p].ammo_amount[*insptr] >= max_ammo_amount[*insptr]) { killit_flag = 2; break; } - addammo( *insptr, &ps[g_p], *(insptr+1) ); + addammo(*insptr, &ps[g_p], *(insptr+1)); if (ps[g_p].curr_weapon == KNEE_WEAPON) - if ( ps[g_p].gotweapon[*insptr]) { + if (ps[g_p].gotweapon[*insptr]) { if (!(ps[g_p].weaponswitch & 1)) addweaponnoswitch(&ps[g_p], *insptr); - else addweapon( &ps[g_p], *insptr ); + else addweapon(&ps[g_p], *insptr); } insptr+=2; break; @@ -4136,7 +4136,7 @@ SKIPJIBS: if (g_sp->picnum != ATOMICHEALTH) { - if ( j > max_player_health && *insptr > 0 ) + if (j > max_player_health && *insptr > 0) { insptr++; break; @@ -4145,15 +4145,15 @@ SKIPJIBS: { if (j > 0) j += *insptr; - if ( j > max_player_health && *insptr > 0 ) + if (j > max_player_health && *insptr > 0) j = max_player_health; } } else { - if ( j > 0 ) + if (j > 0) j += *insptr; - if ( j > (max_player_health<<1) ) + if (j > (max_player_health<<1)) j = (max_player_health<<1); } @@ -4163,8 +4163,8 @@ SKIPJIBS: { if (*insptr > 0) { - if ( ( j - *insptr ) < (max_player_health>>2) && - j >= (max_player_health>>2) ) + if ((j - *insptr) < (max_player_health>>2) && + j >= (max_player_health>>2)) spritesound(DUKE_GOTHEALTHATLOW,ps[g_p].i); ps[g_p].last_extra = j; @@ -4204,20 +4204,20 @@ SKIPJIBS: case CON_ADDWEAPONVAR: insptr++; - if ( ps[g_p].gotweapon[GetGameVarID(*(insptr),g_i,g_p)] == 0 ) { + if (ps[g_p].gotweapon[GetGameVarID(*(insptr),g_i,g_p)] == 0) { if (!(ps[g_p].weaponswitch & 1)) addweaponnoswitch(&ps[g_p], GetGameVarID(*(insptr),g_i,g_p)); - else addweapon( &ps[g_p], GetGameVarID(*(insptr),g_i,g_p) ); + else addweapon(&ps[g_p], GetGameVarID(*(insptr),g_i,g_p)); } - else if ( ps[g_p].ammo_amount[GetGameVarID(*(insptr),g_i,g_p)] >= max_ammo_amount[GetGameVarID(*(insptr),g_i,g_p)] ) + else if (ps[g_p].ammo_amount[GetGameVarID(*(insptr),g_i,g_p)] >= max_ammo_amount[GetGameVarID(*(insptr),g_i,g_p)]) { killit_flag = 2; break; } - addammo( GetGameVarID(*(insptr),g_i,g_p), &ps[g_p], GetGameVarID(*(insptr+1),g_i,g_p) ); + addammo(GetGameVarID(*(insptr),g_i,g_p), &ps[g_p], GetGameVarID(*(insptr+1),g_i,g_p)); if (ps[g_p].curr_weapon == KNEE_WEAPON) - if ( ps[g_p].gotweapon[GetGameVarID(*(insptr),g_i,g_p)] ) { + if (ps[g_p].gotweapon[GetGameVarID(*(insptr),g_i,g_p)]) { if (!(ps[g_p].weaponswitch & 1)) addweaponnoswitch(&ps[g_p], GetGameVarID(*(insptr),g_i,g_p)); - else addweapon( &ps[g_p], GetGameVarID(*(insptr),g_i,g_p) ); + else addweapon(&ps[g_p], GetGameVarID(*(insptr),g_i,g_p)); } insptr+=2; break; @@ -4376,7 +4376,7 @@ SKIPJIBS: if (volnume > num_volumes || volnume < 0) { /* - if( g_cmddebug&CMDDEBUG_COMPILE) + if(g_cmddebug&CMDDEBUG_COMPILE) { Bsprintf(g_szBuf,"startlevel: Invalid Volume number: %ld. Command ignored.",volnume); AddLog(g_szBuf); @@ -4388,7 +4388,7 @@ SKIPJIBS: if (levnume >= 11 || levnume <0) { /* - if( g_cmddebug&CMDDEBUG_COMPILE) + if(g_cmddebug&CMDDEBUG_COMPILE) { Bsprintf(g_szBuf,"startlevel: Invalid Level number: %ld. Command ignored.",levnume); AddLog(g_szBuf); @@ -4554,7 +4554,7 @@ SKIPJIBS: insptr++; i=*insptr++; // ID of def - SetGameVarID(i, rand(), g_i, g_p ); + SetGameVarID(i, rand(), g_i, g_p); break; } @@ -4627,7 +4627,7 @@ SKIPJIBS: what = mulscale(var2, var3, var4); - SetGameVarID(var1, what, g_i, g_p ); + SetGameVarID(var1, what, g_i, g_p); break; } @@ -4797,10 +4797,10 @@ SKIPJIBS: { case CON_SAVEGAMEVAR: i=GetGameVarID(*insptr, g_i, g_p); - SCRIPT_PutNumber( scripthandle, "Gamevars",aGameVars[*insptr++].szLabel,i,false,false); + SCRIPT_PutNumber(scripthandle, "Gamevars",aGameVars[*insptr++].szLabel,i,false,false); break; case CON_READGAMEVAR: - SCRIPT_GetNumber( scripthandle, "Gamevars",aGameVars[*insptr].szLabel,&i); + SCRIPT_GetNumber(scripthandle, "Gamevars",aGameVars[*insptr].szLabel,&i); SetGameVarID(*insptr++, i, g_i, g_p); break; } @@ -5088,7 +5088,7 @@ SKIPJIBS: case CON_IFWASWEAPON: insptr++; - parseifelse( hittype[g_i].picnum == *insptr); + parseifelse(hittype[g_i].picnum == *insptr); break; case CON_IFAI: @@ -5203,7 +5203,7 @@ SKIPJIBS: //AddLog("resetplayer"); if (ud.multimode < 2) { - if ( lastsavedpos >= 0 && ud.recstat != 2 ) + if (lastsavedpos >= 0 && ud.recstat != 2) { ps[g_p].gm = MODE_MENU; KB_ClearKeyDown(sc_Space); @@ -5277,11 +5277,11 @@ SKIPJIBS: break; case CON_IFONWATER: - parseifelse( klabs(g_sp->z-sector[g_sp->sectnum].floorz) < (32<<8) && sector[g_sp->sectnum].lotag == 1); + parseifelse(klabs(g_sp->z-sector[g_sp->sectnum].floorz) < (32<<8) && sector[g_sp->sectnum].lotag == 1); break; case CON_IFINWATER: - parseifelse( sector[g_sp->sectnum].lotag == 2); + parseifelse(sector[g_sp->sectnum].lotag == 2); break; case CON_IFCOUNT: @@ -5373,47 +5373,47 @@ SKIPJIBS: s = sprite[ps[g_p].i].xvel; - if ( (l&8) && ps[g_p].on_ground && (sync[g_p].bits&2) ) + if ((l&8) && ps[g_p].on_ground && (sync[g_p].bits&2)) j = 1; - else if ( (l&16) && ps[g_p].jumping_counter == 0 && !ps[g_p].on_ground && - ps[g_p].poszv > 2048 ) + else if ((l&16) && ps[g_p].jumping_counter == 0 && !ps[g_p].on_ground && + ps[g_p].poszv > 2048) j = 1; - else if ( (l&32) && ps[g_p].jumping_counter > 348 ) + else if ((l&32) && ps[g_p].jumping_counter > 348) j = 1; - else if ( (l&1) && s >= 0 && s < 8) + else if ((l&1) && s >= 0 && s < 8) j = 1; - else if ( (l&2) && s >= 8 && !(sync[g_p].bits&(1<<5)) ) + else if ((l&2) && s >= 8 && !(sync[g_p].bits&(1<<5))) j = 1; - else if ( (l&4) && s >= 8 && sync[g_p].bits&(1<<5) ) + else if ((l&4) && s >= 8 && sync[g_p].bits&(1<<5)) j = 1; - else if ( (l&64) && ps[g_p].posz < (g_sp->z-(48<<8)) ) + else if ((l&64) && ps[g_p].posz < (g_sp->z-(48<<8))) j = 1; - else if ( (l&128) && s <= -8 && !(sync[g_p].bits&(1<<5)) ) + else if ((l&128) && s <= -8 && !(sync[g_p].bits&(1<<5))) j = 1; - else if ( (l&256) && s <= -8 && (sync[g_p].bits&(1<<5)) ) + else if ((l&256) && s <= -8 && (sync[g_p].bits&(1<<5))) j = 1; - else if ( (l&512) && ( ps[g_p].quick_kick > 0 || ( ps[g_p].curr_weapon == KNEE_WEAPON && ps[g_p].kickback_pic > 0 ) ) ) + else if ((l&512) && (ps[g_p].quick_kick > 0 || (ps[g_p].curr_weapon == KNEE_WEAPON && ps[g_p].kickback_pic > 0))) j = 1; - else if ( (l&1024) && sprite[ps[g_p].i].xrepeat < 32 ) + else if ((l&1024) && sprite[ps[g_p].i].xrepeat < 32) j = 1; - else if ( (l&2048) && ps[g_p].jetpack_on ) + else if ((l&2048) && ps[g_p].jetpack_on) j = 1; - else if ( (l&4096) && ps[g_p].steroids_amount > 0 && ps[g_p].steroids_amount < 400 ) + else if ((l&4096) && ps[g_p].steroids_amount > 0 && ps[g_p].steroids_amount < 400) j = 1; - else if ( (l&8192) && ps[g_p].on_ground) + else if ((l&8192) && ps[g_p].on_ground) j = 1; - else if ( (l&16384) && sprite[ps[g_p].i].xrepeat > 32 && sprite[ps[g_p].i].extra > 0 && ps[g_p].timebeforeexit == 0 ) + else if ((l&16384) && sprite[ps[g_p].i].xrepeat > 32 && sprite[ps[g_p].i].extra > 0 && ps[g_p].timebeforeexit == 0) j = 1; - else if ( (l&32768) && sprite[ps[g_p].i].extra <= 0) + else if ((l&32768) && sprite[ps[g_p].i].extra <= 0) j = 1; - else if ( (l&65536L) ) + else if ((l&65536L)) { if (g_sp->picnum == APLAYER && ud.multimode > 1) j = getincangle(ps[otherp].ang,getangle(ps[g_p].posx-ps[otherp].posx,ps[g_p].posy-ps[otherp].posy)); else j = getincangle(ps[g_p].ang,getangle(g_sp->x-ps[g_p].posx,g_sp->y-ps[g_p].posy)); - if ( j > -128 && j < 128 ) + if (j > -128 && j < 128) j = 1; else j = 0; @@ -5435,7 +5435,7 @@ SKIPJIBS: case CON_IFSPAWNEDBY: insptr++; - parseifelse( hittype[g_i].picnum == *insptr); + parseifelse(hittype[g_i].picnum == *insptr); break; case CON_WACKPLAYER: @@ -5458,11 +5458,11 @@ SKIPJIBS: case CON_IFGAPZL: insptr++; - parseifelse( (( hittype[g_i].floorz - hittype[g_i].ceilingz ) >> 8 ) < *insptr); + parseifelse(((hittype[g_i].floorz - hittype[g_i].ceilingz) >> 8) < *insptr); break; case CON_IFHITSPACE: - parseifelse( sync[g_p].bits&(1<<29)); + parseifelse(sync[g_p].bits&(1<<29)); break; case CON_IFOUTSIDE: @@ -5475,13 +5475,13 @@ SKIPJIBS: case CON_OPERATE: insptr++; - if ( sector[g_sp->sectnum].lotag == 0 ) + if (sector[g_sp->sectnum].lotag == 0) { neartag(g_sp->x,g_sp->y,g_sp->z-(32<<8),g_sp->sectnum,g_sp->ang,&neartagsector,&neartagwall,&neartagsprite,&neartaghitdist,768L,1); - if ( neartagsector >= 0 && isanearoperator(sector[neartagsector].lotag) ) - if ( (sector[neartagsector].lotag&0xff) == 23 || sector[neartagsector].floorz == sector[neartagsector].ceilingz ) - if ( (sector[neartagsector].lotag&16384) == 0 ) - if ( (sector[neartagsector].lotag&32768) == 0 ) + if (neartagsector >= 0 && isanearoperator(sector[neartagsector].lotag)) + if ((sector[neartagsector].lotag&0xff) == 23 || sector[neartagsector].floorz == sector[neartagsector].ceilingz) + if ((sector[neartagsector].lotag&16384) == 0) + if ((sector[neartagsector].lotag&32768) == 0) { j = headspritesect[neartagsector]; while (j >= 0) @@ -5513,26 +5513,26 @@ SKIPJIBS: break; case CON_IFBULLETNEAR: - parseifelse( dodge(g_sp) == 1); + parseifelse(dodge(g_sp) == 1); break; case CON_IFRESPAWN: - if ( badguy(g_sp) ) - parseifelse( ud.respawn_monsters ); - else if ( inventory(g_sp) ) - parseifelse( ud.respawn_inventory ); + if (badguy(g_sp)) + parseifelse(ud.respawn_monsters); + else if (inventory(g_sp)) + parseifelse(ud.respawn_inventory); else - parseifelse( ud.respawn_items ); + parseifelse(ud.respawn_items); break; case CON_IFFLOORDISTL: insptr++; - parseifelse( (hittype[g_i].floorz - g_sp->z) <= ((*insptr)<<8)); + parseifelse((hittype[g_i].floorz - g_sp->z) <= ((*insptr)<<8)); break; case CON_IFCEILINGDISTL: insptr++; - parseifelse( ( g_sp->z - hittype[g_i].ceilingz ) <= ((*insptr)<<8)); + parseifelse((g_sp->z - hittype[g_i].ceilingz) <= ((*insptr)<<8)); break; case CON_PALFROM: @@ -5582,7 +5582,7 @@ SKIPJIBS: l=*insptr++; // l=Line number, *instpr=varID lVarID = *insptr; - if ( (lVarID >= iGameVarCount) || lVarID < 0) + if ((lVarID >= iGameVarCount) || lVarID < 0) { if (*insptr==MAXGAMEVARS) // addlogvar for a constant? Har. insptr++; @@ -5602,16 +5602,16 @@ good: Bsprintf(szBuf,"CONLOGVAR: L=%ld %s ",l, aGameVars[lVarID].szLabel); strcpy(g_szBuf,szBuf); - if ( aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_READONLY) + if (aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_READONLY) { Bsprintf(szBuf," (read-only)"); strcat(g_szBuf,szBuf); } - if ( aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_PERPLAYER) + if (aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_PERPLAYER) { Bsprintf(szBuf," (Per Player. Player=%d)",g_p); } - else if ( aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_PERACTOR) + else if (aGameVars[lVarID].dwFlags & GAMEVAR_FLAG_PERACTOR) { Bsprintf(szBuf," (Per Actor. Actor=%d)",g_i); } @@ -5737,7 +5737,7 @@ good: if (tw==CON_FINDNEARACTOR3DVAR || tw==CON_FINDNEARSPRITE3DVAR) lTemp=dist(&sprite[g_i], &sprite[j]); else lTemp=ldist(&sprite[g_i], &sprite[j]); - if ( lTemp < lMaxDist) + if (lTemp < lMaxDist) { lFound=j; j = MAXSPRITES; @@ -6073,7 +6073,7 @@ good: // hittype[g_i].lastvx and lastvy are last known location of target. ang=getangle(hittype[g_i].lastvx-g_sp->x,hittype[g_i].lastvy-g_sp->y); - SetGameVarID(i, ang, g_i, g_p ); + SetGameVarID(i, ang, g_i, g_p); break; } @@ -6123,7 +6123,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, ps[g_p].ang, g_i, g_p ); + SetGameVarID(i, ps[g_p].ang, g_i, g_p); break; } @@ -6142,7 +6142,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, g_sp->ang, g_i, g_p ); + SetGameVarID(i, g_sp->ang, g_i, g_p); break; } @@ -6161,7 +6161,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, *insptr++, g_i, g_p ); + SetGameVarID(i, *insptr++, g_i, g_p); break; } @@ -6170,7 +6170,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(*insptr++, g_i, g_p), g_i, g_p ); + SetGameVarID(i, GetGameVarID(*insptr++, g_i, g_p), g_i, g_p); break; } @@ -6179,7 +6179,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, mulscale(krand(), *(insptr++)+1, 16), g_i, g_p ); + SetGameVarID(i, mulscale(krand(), *(insptr++)+1, 16), g_i, g_p); break; } @@ -6188,7 +6188,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, mulscale(rand(), *(insptr++)+1, 15), g_i, g_p ); + SetGameVarID(i, mulscale(rand(), *(insptr++)+1, 15), g_i, g_p); break; } @@ -6197,7 +6197,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) * *insptr++, g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) * *insptr++, g_i, g_p); break; } @@ -6206,9 +6206,9 @@ good: int i; insptr++; i=*insptr++; // ID of def - if ( (*insptr) == 0 ) + if ((*insptr) == 0) gameexit("CON_DIVVAR: Divide by zero."); - SetGameVarID(i, GetGameVarID(i, g_i, g_p) / *insptr++, g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) / *insptr++, g_i, g_p); break; } @@ -6219,9 +6219,9 @@ good: insptr++; i=*insptr++; // ID of def l=*insptr++; - if ( l == 0 ) + if (l == 0) gameexit("CON_MODVAR: Mod by zero."); - SetGameVarID(i,GetGameVarID(i, g_i, g_p)%l, g_i, g_p ); + SetGameVarID(i,GetGameVarID(i, g_i, g_p)%l, g_i, g_p); break; } @@ -6232,7 +6232,7 @@ good: insptr++; i=*insptr++; // ID of def l=*insptr++; - SetGameVarID(i,GetGameVarID(i, g_i, g_p) & l, g_i, g_p ); + SetGameVarID(i,GetGameVarID(i, g_i, g_p) & l, g_i, g_p); break; } @@ -6243,7 +6243,7 @@ good: insptr++; i=*insptr++; // ID of def l=*insptr++; - SetGameVarID(i,GetGameVarID(i, g_i, g_p) | l, g_i, g_p ); + SetGameVarID(i,GetGameVarID(i, g_i, g_p) | l, g_i, g_p); break; } @@ -6254,7 +6254,7 @@ good: insptr++; i=*insptr++; // ID of def l=*insptr++; - SetGameVarID(i,GetGameVarID(i, g_i, g_p) ^ l, g_i, g_p ); + SetGameVarID(i,GetGameVarID(i, g_i, g_p) ^ l, g_i, g_p); break; } @@ -6265,7 +6265,7 @@ good: insptr++; i=*insptr++; // ID of def l1=GetGameVarID(*insptr++, g_i, g_p); - SetGameVarID(i,mulscale(krand(), l1+1, 16), g_i, g_p ); + SetGameVarID(i,mulscale(krand(), l1+1, 16), g_i, g_p); break; } @@ -6277,7 +6277,7 @@ good: i=*insptr++; // ID of def l1=GetGameVarID(*insptr++, g_i, g_p); - SetGameVarID(i,mulscale(rand(), l1+1, 15), g_i, g_p ); + SetGameVarID(i,mulscale(rand(), l1+1, 15), g_i, g_p); break; } @@ -6288,7 +6288,7 @@ good: insptr++; i=*insptr++; // ID of def l1=GetGameVarID(i, g_i, g_p); - SetGameVarID(*insptr++, max_ammo_amount[l1], g_i, g_p ); + SetGameVarID(*insptr++, max_ammo_amount[l1], g_i, g_p); break; } @@ -6312,7 +6312,7 @@ good: i=*insptr++; // ID of def l1=GetGameVarID(i, g_i, g_p); l2=GetGameVarID(*insptr++, g_i, g_p); - SetGameVarID(i, l1*l2, g_i, g_p ); + SetGameVarID(i, l1*l2, g_i, g_p); break; } @@ -6328,7 +6328,7 @@ good: { gameexit("CON_DIVVARVAR: Divide by zero."); } - SetGameVarID(i, l1/l2 , g_i, g_p ); + SetGameVarID(i, l1/l2 , g_i, g_p); break; } @@ -6342,7 +6342,7 @@ good: l2=GetGameVarID(*insptr++, g_i, g_p); if (l2==0) gameexit("CON_MODVARVAR: Mod by zero."); - SetGameVarID(i, l1 % l2, g_i, g_p ); + SetGameVarID(i, l1 % l2, g_i, g_p); break; } @@ -6354,7 +6354,7 @@ good: i=*insptr++; // ID of def l1=GetGameVarID(i, g_i, g_p); l2=GetGameVarID(*insptr++, g_i, g_p); - SetGameVarID(i, l1 & l2 , g_i, g_p ); + SetGameVarID(i, l1 & l2 , g_i, g_p); break; } @@ -6366,7 +6366,7 @@ good: i=*insptr++; // ID of def l1=GetGameVarID(i, g_i, g_p); l2=GetGameVarID(*insptr++, g_i, g_p); - SetGameVarID(i, l1 ^ l2 , g_i, g_p ); + SetGameVarID(i, l1 ^ l2 , g_i, g_p); break; } @@ -6378,7 +6378,7 @@ good: i=*insptr++; // ID of def l1=GetGameVarID(i, g_i, g_p); l2=GetGameVarID(*insptr++, g_i, g_p); - SetGameVarID(i, l1 | l2 , g_i, g_p ); + SetGameVarID(i, l1 | l2 , g_i, g_p); break; } @@ -6387,7 +6387,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) - *insptr++, g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) - *insptr++, g_i, g_p); break; } @@ -6396,7 +6396,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) - GetGameVarID(*insptr++, g_i, g_p), g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) - GetGameVarID(*insptr++, g_i, g_p), g_i, g_p); break; } @@ -6405,7 +6405,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) + *insptr++, g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) + *insptr++, g_i, g_p); break; } @@ -6414,7 +6414,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) << *insptr++, g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) << *insptr++, g_i, g_p); break; } @@ -6423,7 +6423,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) >> *insptr++, g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) >> *insptr++, g_i, g_p); break; } @@ -6435,7 +6435,7 @@ good: i=*insptr++; // ID of def lValue=GetGameVarID(*insptr++, g_i, g_p); lValue=sintable[lValue&2047]; - SetGameVarID(i, lValue , g_i, g_p ); + SetGameVarID(i, lValue , g_i, g_p); break; } @@ -6447,7 +6447,7 @@ good: i=*insptr++; // ID of def lValue=GetGameVarID(*insptr++, g_i, g_p); lValue=sintable[(lValue+512)&2047]; - SetGameVarID(i, lValue , g_i, g_p ); + SetGameVarID(i, lValue , g_i, g_p); break; } @@ -6456,7 +6456,7 @@ good: int i; insptr++; i=*insptr++; // ID of def - SetGameVarID(i, GetGameVarID(i, g_i, g_p) + GetGameVarID(*insptr++, g_i, g_p), g_i, g_p ); + SetGameVarID(i, GetGameVarID(i, g_i, g_p) + GetGameVarID(*insptr++, g_i, g_p), g_i, g_p); break; } @@ -6516,9 +6516,9 @@ good: insptr++; i=*insptr++; // ID of def j=0; - if (GetGameVarID(i, g_i, g_p) & GetGameVarID(*(insptr), g_i, g_p) ) + if (GetGameVarID(i, g_i, g_p) & GetGameVarID(*(insptr), g_i, g_p)) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6528,9 +6528,9 @@ good: insptr++; i=*insptr++; // ID of def j=0; - if (GetGameVarID(i, g_i, g_p) != GetGameVarID(*(insptr), g_i, g_p) ) + if (GetGameVarID(i, g_i, g_p) != GetGameVarID(*(insptr), g_i, g_p)) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6540,9 +6540,9 @@ good: insptr++; i=*insptr++; // ID of def j=0; - if (GetGameVarID(i, g_i, g_p) == GetGameVarID(*(insptr), g_i, g_p) ) + if (GetGameVarID(i, g_i, g_p) == GetGameVarID(*(insptr), g_i, g_p)) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6552,9 +6552,9 @@ good: insptr++; i=*insptr++; // ID of def j=0; - if (GetGameVarID(i, g_i, g_p) > GetGameVarID(*(insptr), g_i, g_p) ) + if (GetGameVarID(i, g_i, g_p) > GetGameVarID(*(insptr), g_i, g_p)) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6564,9 +6564,9 @@ good: insptr++; i=*insptr++; // ID of def j=0; - if (GetGameVarID(i, g_i, g_p) < GetGameVarID(*(insptr), g_i, g_p) ) + if (GetGameVarID(i, g_i, g_p) < GetGameVarID(*(insptr), g_i, g_p)) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6578,7 +6578,7 @@ good: j=0; if (GetGameVarID(i, g_i, g_p) == *insptr) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6590,7 +6590,7 @@ good: j=0; if (GetGameVarID(i, g_i, g_p) != *insptr) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6609,7 +6609,7 @@ good: if (GetGameVarID(i, g_i, g_p) != *insptr) j=1; - parseifelse( j ); + parseifelse(j); } break; } @@ -6630,7 +6630,7 @@ good: if (GetGameVarID(i, g_i, g_p) != GetGameVarID(k, g_i, g_p)) j=1; - parseifelse( j ); + parseifelse(j); } break; } @@ -6643,7 +6643,7 @@ good: j=0; if (GetGameVarID(i, g_i, g_p) & *insptr) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6655,7 +6655,7 @@ good: j=0; if (GetGameVarID(i, g_i, g_p) > *insptr) j=1; - parseifelse( j ); + parseifelse(j); break; } @@ -6667,13 +6667,13 @@ good: j=0; if (GetGameVarID(i, g_i, g_p) < *insptr) j=1; - parseifelse( j ); + parseifelse(j); break; } case CON_IFPHEALTHL: insptr++; - parseifelse( sprite[ps[g_p].i].extra < *insptr); + parseifelse(sprite[ps[g_p].i].extra < *insptr); break; case CON_IFPINVENTORY: @@ -6683,11 +6683,11 @@ good: switch (*insptr++) { case GET_STEROIDS: - if ( ps[g_p].steroids_amount != *insptr) + if (ps[g_p].steroids_amount != *insptr) j = 1; break; case GET_SHIELD: - if (ps[g_p].shield_amount != max_player_health ) + if (ps[g_p].shield_amount != max_player_health) j = 1; break; case GET_SCUBA: @@ -6721,8 +6721,8 @@ good: case CON_PSTOMP: insptr++; - if ( ps[g_p].knee_incs == 0 && sprite[ps[g_p].i].xrepeat >= 40 ) - if ( cansee(g_sp->x,g_sp->y,g_sp->z-(4<<8),g_sp->sectnum,ps[g_p].posx,ps[g_p].posy,ps[g_p].posz+(16<<8),sprite[ps[g_p].i].sectnum) ) + if (ps[g_p].knee_incs == 0 && sprite[ps[g_p].i].xrepeat >= 40) + if (cansee(g_sp->x,g_sp->y,g_sp->z-(4<<8),g_sp->sectnum,ps[g_p].posx,ps[g_p].posy,ps[g_p].posz+(16<<8),sprite[ps[g_p].i].sectnum)) { int i; for (i=0;ix+108,g_sp->y+108,&s1); - if ( s1 == g_sp->sectnum ) + if (s1 == g_sp->sectnum) { updatesector(g_sp->x-108,g_sp->y-108,&s1); - if ( s1 == g_sp->sectnum ) + if (s1 == g_sp->sectnum) { updatesector(g_sp->x+108,g_sp->y-108,&s1); - if ( s1 == g_sp->sectnum ) + if (s1 == g_sp->sectnum) { updatesector(g_sp->x-108,g_sp->y+108,&s1); - if ( s1 == g_sp->sectnum ) + if (s1 == g_sp->sectnum) j = 1; } } } - parseifelse( j ); + parseifelse(j); } break; @@ -6788,11 +6788,11 @@ good: break; case CON_IFINOUTERSPACE: - parseifelse( floorspace(g_sp->sectnum)); + parseifelse(floorspace(g_sp->sectnum)); break; case CON_IFNOTMOVING: - parseifelse( (hittype[g_i].movflag&49152) > 16384 ); + parseifelse((hittype[g_i].movflag&49152) > 16384); break; case CON_RESPAWNHITAG: @@ -6822,21 +6822,21 @@ good: case CON_IFSPRITEPAL: insptr++; - parseifelse( g_sp->pal == *insptr); + parseifelse(g_sp->pal == *insptr); break; case CON_IFANGDIFFL: insptr++; j = klabs(getincangle(ps[g_p].ang,g_sp->ang)); - parseifelse( j <= *insptr); + parseifelse(j <= *insptr); break; case CON_IFNOSOUNDS: for (j=1;jpicnum] == 0 ) return; + if (actorLoadEventScrptr[g_sp->picnum] == 0) return; insptr = actorLoadEventScrptr[g_sp->picnum]; @@ -6899,12 +6899,12 @@ void LoadActor(short sActor,short sPlayer,long lDist) } do done = parse(); - while ( done == 0 ); + while (done == 0); if (killit_flag == 1) { // if player was set to squish, first stop that... - if (g_p >= 0 ) + if (g_p >= 0) { if (ps[g_p].actorsqu == g_i) ps[g_p].actorsqu = -1; @@ -6923,7 +6923,7 @@ void execute(short sActor,short sPlayer,long lDist) g_sp = &sprite[g_i]; // Pointer to sprite structure g_t = &hittype[g_i].temp_data[0]; // Sprite's 'extra' data - if ( actorscrptr[g_sp->picnum] == 0 ) return; + if (actorscrptr[g_sp->picnum] == 0) return; insptr = 4 + (actorscrptr[g_sp->picnum]); @@ -6941,20 +6941,20 @@ void execute(short sActor,short sPlayer,long lDist) { g_sp->lotag += TICSPERFRAME; - if (g_sp->lotag > *(long *)(g_t[4]+16) ) + if (g_sp->lotag > *(long *)(g_t[4]+16)) { g_t[2]++; g_sp->lotag = 0; - g_t[3] += *(long *)( g_t[4]+12 ); + g_t[3] += *(long *)(g_t[4]+12); } - if ( klabs(g_t[3]) >= klabs( *(long *)(g_t[4]+4) * *(long *)(g_t[4]+12) ) ) + if (klabs(g_t[3]) >= klabs(*(long *)(g_t[4]+4) * *(long *)(g_t[4]+12))) g_t[3] = 0; } do done = parse(); - while ( done == 0 ); + while (done == 0); if (killit_flag == 1) { @@ -6967,14 +6967,14 @@ void execute(short sActor,short sPlayer,long lDist) { move(); - if ( g_sp->statnum == 1) + if (g_sp->statnum == 1) { - if ( badguy(g_sp) ) + if (badguy(g_sp)) { - if ( g_sp->xrepeat > 60 ) return; - if ( ud.respawn_monsters == 1 && g_sp->extra <= 0 ) return; + if (g_sp->xrepeat > 60) return; + if (ud.respawn_monsters == 1 && g_sp->extra <= 0) return; } - else if ( ud.respawn_items == 1 && (g_sp->cstat&32768) ) return; + else if (ud.respawn_items == 1 && (g_sp->cstat&32768)) return; if (hittype[g_i].timetosleep > 1) hittype[g_i].timetosleep--; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 0d6288e11..f7f99471b 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -51,10 +51,10 @@ void cmenu(short cm) { current_menu = cm; - if ( (cm >= 1000 && cm <= 1009) ) + if ((cm >= 1000 && cm <= 1009)) return; - if ( cm == 0 ) + if (cm == 0) probey = last_zero; else if (cm == 50) probey = last_fifty; @@ -114,36 +114,36 @@ static int probe_(int type,int x,int y,int i,int n) s = 1+(CONTROL_GetMouseSensitivity()>>4); { - CONTROL_GetInput( &minfo ); + CONTROL_GetInput(&minfo); mi += minfo.dz; } - if ( x == (320>>1) ) + if (x == (320>>1)) centre = 320>>2; else centre = 0; if (!buttonstat) { - if ( KB_KeyPressed( sc_UpArrow ) || KB_KeyPressed( sc_PgUp ) || KB_KeyPressed( sc_kpad_8 ) || - mi < -8192 ) + if (KB_KeyPressed(sc_UpArrow) || KB_KeyPressed(sc_PgUp) || KB_KeyPressed(sc_kpad_8) || + mi < -8192) { mi = 0; - KB_ClearKeyDown( sc_UpArrow ); - KB_ClearKeyDown( sc_kpad_8 ); - KB_ClearKeyDown( sc_PgUp ); + KB_ClearKeyDown(sc_UpArrow); + KB_ClearKeyDown(sc_kpad_8); + KB_ClearKeyDown(sc_PgUp); sound(KICK_HIT); probey--; if (probey < 0) probey = n-1; minfo.dz = 0; } - if ( KB_KeyPressed( sc_DownArrow ) || KB_KeyPressed( sc_PgDn ) || KB_KeyPressed( sc_kpad_2 ) - || mi > 8192 ) + if (KB_KeyPressed(sc_DownArrow) || KB_KeyPressed(sc_PgDn) || KB_KeyPressed(sc_kpad_2) + || mi > 8192) { mi = 0; - KB_ClearKeyDown( sc_DownArrow ); - KB_ClearKeyDown( sc_kpad_2 ); - KB_ClearKeyDown( sc_PgDn ); + KB_ClearKeyDown(sc_DownArrow); + KB_ClearKeyDown(sc_kpad_2); + KB_ClearKeyDown(sc_PgDn); sound(KICK_HIT); probey++; minfo.dz = 0; @@ -164,28 +164,28 @@ static int probe_(int type,int x,int y,int i,int n) else rotatesprite((x<<16)-((tilesizx[BIGFNTCURSOR]-4)<<(16-type)),(y+(probey*i)-(4>>type))<<16,65536L>>type,0,SPINNINGNUKEICON+(((totalclock>>3))%7),sh,0,10,0,0,xdim-1,ydim-1); - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed( sc_kpad_Enter ) || KB_KeyPressed( sc_Enter ) || (LMB && !onbar) ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Enter) || (LMB && !onbar)) { if (current_menu != 110) sound(PISTOL_BODYHIT); - KB_ClearKeyDown( sc_Enter ); - KB_ClearKeyDown( sc_Space ); - KB_ClearKeyDown( sc_kpad_Enter ); + KB_ClearKeyDown(sc_Enter); + KB_ClearKeyDown(sc_Space); + KB_ClearKeyDown(sc_kpad_Enter); return(probey); } - else if ( KB_KeyPressed( sc_Escape ) || (RMB) ) + else if (KB_KeyPressed(sc_Escape) || (RMB)) { onbar = 0; - KB_ClearKeyDown( sc_Escape ); + KB_ClearKeyDown(sc_Escape); sound(EXITMENUSOUND); return(-1); } else { if (onbar == 0) return(-probey-2); - if ( KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || ((buttonstat&1) && minfo.dyaw < -128 ) ) + if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -128)) return(probey); - else if ( KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || ((buttonstat&1) && minfo.dyaw > 128 ) ) + else if (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 128)) return(probey); else return(-probey-2); } @@ -201,9 +201,9 @@ int menutext_(int x,int y,short s,short p,char *t) i = centre = 0; - if ( x == (320>>1) ) + if (x == (320>>1)) { - while ( *(t+i) ) + while (*(t+i)) { if (*(t+i) == ' ') { @@ -326,20 +326,20 @@ static void bar_(int type, int x,int y,short *p,short dainc,char damodify,short { if (rev == 0) { - if ( *p > 0 && (KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || ((buttonstat&1) && minfo.dyaw < -256 ) ) ) // && onbar) ) + if (*p > 0 && (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256))) // && onbar) ) { - KB_ClearKeyDown( sc_LeftArrow ); - KB_ClearKeyDown( sc_kpad_4 ); + KB_ClearKeyDown(sc_LeftArrow); + KB_ClearKeyDown(sc_kpad_4); *p -= dainc; if (*p < 0) *p = 0; sound(KICK_HIT); } - if ( *p < 63 && (KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || ((buttonstat&1) && minfo.dyaw > 256 ) ) )//&& onbar) ) + if (*p < 63 && (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256))) //&& onbar) ) { - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_6 ); + KB_ClearKeyDown(sc_RightArrow); + KB_ClearKeyDown(sc_kpad_6); *p += dainc; if (*p > 63) @@ -349,20 +349,20 @@ static void bar_(int type, int x,int y,short *p,short dainc,char damodify,short } else { - if ( *p > 0 && (KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || ((buttonstat&1) && minfo.dyaw > 256 ) ) )//&& onbar) ) + if (*p > 0 && (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256))) //&& onbar) ) { - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_6 ); + KB_ClearKeyDown(sc_RightArrow); + KB_ClearKeyDown(sc_kpad_6); *p -= dainc; if (*p < 0) *p = 0; sound(KICK_HIT); } - if ( *p < 64 && (KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || ((buttonstat&1) && minfo.dyaw < -256 ) ) ) // && onbar) ) + if (*p < 64 && (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256))) // && onbar) ) { - KB_ClearKeyDown( sc_LeftArrow ); - KB_ClearKeyDown( sc_kpad_4 ); + KB_ClearKeyDown(sc_LeftArrow); + KB_ClearKeyDown(sc_kpad_4); *p += dainc; if (*p > 64) @@ -374,11 +374,11 @@ static void bar_(int type, int x,int y,short *p,short dainc,char damodify,short xloc = *p; - rotatesprite( (x<<16)+(22<<(16-type)),(y<<16)-(3<<(16-type)),65536L>>type,0,SLIDEBAR,s,pa,10,0,0,xdim-1,ydim-1); + rotatesprite((x<<16)+(22<<(16-type)),(y<<16)-(3<<(16-type)),65536L>>type,0,SLIDEBAR,s,pa,10,0,0,xdim-1,ydim-1); if (rev == 0) - rotatesprite( (x<<16)+((xloc+1)<<(16-type)),(y<<16)+(1<<(16-type)),65536L>>type,0,SLIDEBAR+1,s,pa,10,0,0,xdim-1,ydim-1); + rotatesprite((x<<16)+((xloc+1)<<(16-type)),(y<<16)+(1<<(16-type)),65536L>>type,0,SLIDEBAR+1,s,pa,10,0,0,xdim-1,ydim-1); else - rotatesprite( (x<<16)+((65-xloc)<<(16-type)),(y<<16)+(1<<(16-type)),65536L>>type,0,SLIDEBAR+1,s,pa,10,0,0,xdim-1,ydim-1); + rotatesprite((x<<16)+((65-xloc)<<(16-type)),(y<<16)+(1<<(16-type)),65536L>>type,0,SLIDEBAR+1,s,pa,10,0,0,xdim-1,ydim-1); } void bar(int x,int y,short *p,short dainc,char damodify,short s, short pa) { bar_(0,x,y,p,dainc,damodify,s,pa); } @@ -395,20 +395,20 @@ static void modval(int min, int max,int *p,short dainc,char damodify) { if (rev == 0) { - if ( KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || ((buttonstat&1) && minfo.dyaw < -256 ) ) // && onbar) ) + if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256)) // && onbar) ) { - KB_ClearKeyDown( sc_LeftArrow ); - KB_ClearKeyDown( sc_kpad_4 ); + KB_ClearKeyDown(sc_LeftArrow); + KB_ClearKeyDown(sc_kpad_4); *p -= dainc; if (*p < min) *p = max; sound(PISTOL_BODYHIT); } - if ( KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || ((buttonstat&1) && minfo.dyaw > 256 ) )//&& onbar) ) + if (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256)) //&& onbar) ) { - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_6 ); + KB_ClearKeyDown(sc_RightArrow); + KB_ClearKeyDown(sc_kpad_6); *p += dainc; if (*p > max) @@ -418,20 +418,20 @@ static void modval(int min, int max,int *p,short dainc,char damodify) } else { - if ( KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || ((buttonstat&1) && minfo.dyaw > 256 ))//&& onbar )) + if (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256)) //&& onbar )) { - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_6 ); + KB_ClearKeyDown(sc_RightArrow); + KB_ClearKeyDown(sc_kpad_6); *p -= dainc; if (*p < min) *p = max; sound(PISTOL_BODYHIT); } - if ( KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || ((buttonstat&1) && minfo.dyaw < -256 ))// && onbar) ) + if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256)) // && onbar) ) { - KB_ClearKeyDown( sc_LeftArrow ); - KB_ClearKeyDown( sc_kpad_4 ); + KB_ClearKeyDown(sc_LeftArrow); + KB_ClearKeyDown(sc_kpad_4); *p += dainc; if (*p > max) @@ -522,7 +522,7 @@ void sendquit(void) { int i; - if ( gamequit == 0 && ( numplayers > 1 ) ) + if (gamequit == 0 && (numplayers > 1)) { if (ps[myconnectindex].gm&MODE_GAME) { @@ -542,10 +542,10 @@ void sendquit(void) gameexit(" "); } } - else if ( numplayers < 2 ) + else if (numplayers < 2) gameexit(" "); - if ( ( totalclock > quittimer ) && ( gamequit == 1) ) + if ((totalclock > quittimer) && (gamequit == 1)) gameexit("Timed out."); } @@ -562,14 +562,14 @@ void menus(void) if (buttonstat != 0 && !onbar) { x = MOUSE_GetButtons()<<3; - if ( x ) buttonstat = x<<3; + if (x) buttonstat = x<<3; else buttonstat = 0; } else buttonstat = MOUSE_GetButtons(); } - if ( (ps[myconnectindex].gm&MODE_MENU) == 0 ) + if ((ps[myconnectindex].gm&MODE_MENU) == 0) { walock[TILE_LOADSHOT] = 1; return; @@ -634,7 +634,7 @@ void menus(void) gametext(160,140+8,"VERSION OF DUKE NUKEM 3D.",0,2+8+16); gametext(160,149+16,"PRESS ANY KEY...",0,2+8+16); - if ( x >= -1 ) cmenu(100); + if (x >= -1) cmenu(100); break; case 20001: @@ -999,7 +999,7 @@ void menus(void) if (VOLUMEALL) { menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),boardfilename[0] == 0,"USER MAP"); - if ( boardfilename[0] != 0 ) + if (boardfilename[0] != 0) gametext(c+70+44,57+16+16+16+16+16,boardfilename,0,2+8+16); } else { menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),1,"USER MAP"); @@ -1088,7 +1088,7 @@ void menus(void) gametext(160,99+9,"(Y/N)",0,2+8+16); - if ( KB_KeyPressed(sc_Escape) || KB_KeyPressed(sc_N) || RMB) + if (KB_KeyPressed(sc_Escape) || KB_KeyPressed(sc_N) || RMB) { if (sprite[ps[myconnectindex].i].extra <= 0) { @@ -1107,7 +1107,7 @@ void menus(void) } } - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { KB_FlushKeyboardQueue(); KB_ClearKeysDown(); @@ -1150,20 +1150,20 @@ void menus(void) gametext(160,50+16+16+16+16-12,"ENTER PASSWORD",0,2+8+16); x = strget((320>>1),50+16+16+16+16,buf,19, 998); - if ( x ) + if (x) { - if (ud.pwlockout[0] == 0 || ud.lockout == 0 ) + if (ud.pwlockout[0] == 0 || ud.lockout == 0) strcpy(&ud.pwlockout[0],buf); - else if ( strcmp(buf,&ud.pwlockout[0]) == 0 ) + else if (strcmp(buf,&ud.pwlockout[0]) == 0) { ud.lockout = 0; buf[0] = 0; for (x=0;x= 0 ) + wall[animwall[x].wallnum].picnum != W_SCREENBREAK+2) + if (wall[animwall[x].wallnum].extra >= 0) wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra; } @@ -1177,16 +1177,16 @@ void menus(void) { if (x == 0) { - if ( ud.lockout == 1 ) + if (ud.lockout == 1) { if (ud.pwlockout[0] == 0) { ud.lockout = 0; for (x=0;x= 0 ) + wall[animwall[x].wallnum].picnum != W_SCREENBREAK+2) + if (wall[animwall[x].wallnum].extra >= 0) wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra; } else @@ -1257,7 +1257,7 @@ void menus(void) gametext(160,99,tempbuf,0,2+8+16); gametext(160,99+9,"(Y/N)",0,2+8+16); - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { lastsavedpos = current_menu-1000; @@ -1271,7 +1271,7 @@ void menus(void) if (ud.multimode > 1) { - if ( ps[myconnectindex].gm&MODE_GAME ) + if (ps[myconnectindex].gm&MODE_GAME) { loadplayer(-1-lastsavedpos); ps[myconnectindex].gm = MODE_GAME; @@ -1302,7 +1302,7 @@ void menus(void) break; } - if ( KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) + if (KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) { KB_ClearKeyDown(sc_N); KB_ClearKeyDown(sc_Escape); @@ -1325,12 +1325,12 @@ void menus(void) case 1500: - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { KB_FlushKeyboardQueue(); cmenu(100); } - if ( KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) + if (KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) { KB_ClearKeyDown(sc_N); KB_ClearKeyDown(sc_Escape); @@ -1379,7 +1379,7 @@ void menus(void) gametext(160,90,"OVERWRITE previous SAVED game?",0,2+8+16); gametext(160,90+9,"(Y/N)",0,2+8+16); - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { inputloc = strlen(&ud.savegame[current_menu-2000][0]); @@ -1388,7 +1388,7 @@ void menus(void) KB_FlushKeyboardQueue(); break; } - if ( KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) + if (KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) { KB_ClearKeyDown(sc_N); KB_ClearKeyDown(sc_Escape); @@ -1422,11 +1422,11 @@ void menus(void) if (KB_KeyPressed(sc_Escape)) { cmenu(0); break; } - if ( KB_KeyPressed( sc_LeftArrow ) || - KB_KeyPressed( sc_kpad_4 ) || - KB_KeyPressed( sc_UpArrow ) || - KB_KeyPressed( sc_PgUp ) || - KB_KeyPressed( sc_kpad_8 ) ) + if (KB_KeyPressed(sc_LeftArrow) || + KB_KeyPressed(sc_kpad_4) || + KB_KeyPressed(sc_UpArrow) || + KB_KeyPressed(sc_PgUp) || + KB_KeyPressed(sc_kpad_8)) { KB_ClearKeyDown(sc_LeftArrow); KB_ClearKeyDown(sc_kpad_4); @@ -1439,15 +1439,15 @@ void menus(void) if (current_menu < 990) current_menu = 990+l; } else if ( - KB_KeyPressed( sc_PgDn ) || - KB_KeyPressed( sc_Enter ) || - KB_KeyPressed( sc_Space ) || - KB_KeyPressed( sc_kpad_Enter ) || - KB_KeyPressed( sc_RightArrow ) || - KB_KeyPressed( sc_DownArrow ) || - KB_KeyPressed( sc_kpad_2 ) || - KB_KeyPressed( sc_kpad_9 ) || - KB_KeyPressed( sc_kpad_6 ) ) + KB_KeyPressed(sc_PgDn) || + KB_KeyPressed(sc_Enter) || + KB_KeyPressed(sc_Space) || + KB_KeyPressed(sc_kpad_Enter) || + KB_KeyPressed(sc_RightArrow) || + KB_KeyPressed(sc_DownArrow) || + KB_KeyPressed(sc_kpad_2) || + KB_KeyPressed(sc_kpad_9) || + KB_KeyPressed(sc_kpad_6)) { KB_ClearKeyDown(sc_PgDn); KB_ClearKeyDown(sc_Enter); @@ -1663,13 +1663,13 @@ cheat_for_port_credits: x = probe(c,67,16,6); if (x >= 0) { - if ( ud.multimode > 1 && x == 0 && ud.recstat != 2) + if (ud.multimode > 1 && x == 0 && ud.recstat != 2) { - if ( movesperpacket == 4 && myconnectindex != connecthead ) + if (movesperpacket == 4 && myconnectindex != connecthead) break; last_zero = 0; - cmenu( 600 ); + cmenu(600); } else { @@ -1711,7 +1711,7 @@ cheat_for_port_credits: if (movesperpacket == 4) { - if ( myconnectindex == connecthead ) + if (myconnectindex == connecthead) menutext(c,67,MENUHIGHLIGHT(0),PHX(-2),"NEW GAME"); else menutext(c,67,MENUHIGHLIGHT(0),1,"NEW GAME"); @@ -1806,7 +1806,7 @@ cheat_for_port_credits: break; } - if ( KB_KeyPressed(sc_Q) ) + if (KB_KeyPressed(sc_Q)) cmenu(500); if (movesperpacket == 4 && connecthead != myconnectindex) @@ -1980,15 +1980,15 @@ cheat_for_port_credits: } } - if ( KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || ((buttonstat&1) && minfo.dyaw < -256 ) || - KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || ((buttonstat&1) && minfo.dyaw > 256 ) || - KB_KeyPressed( sc_Tab ) ) + if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256) || + KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256) || + KB_KeyPressed(sc_Tab)) { - KB_ClearKeyDown( sc_LeftArrow ); - KB_ClearKeyDown( sc_kpad_4 ); - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_6 ); - KB_ClearKeyDown( sc_Tab ); + KB_ClearKeyDown(sc_LeftArrow); + KB_ClearKeyDown(sc_kpad_4); + KB_ClearKeyDown(sc_RightArrow); + KB_ClearKeyDown(sc_kpad_6); + KB_ClearKeyDown(sc_Tab); currentlist = 1-currentlist; sound(KICK_HIT); } @@ -2331,10 +2331,10 @@ cheat_for_port_credits: case 10: if (x==io) { enabled = !((ps[myconnectindex].gm&MODE_GAME) && ud.m_recstat != 1); - if ( (ps[myconnectindex].gm&MODE_GAME) ) closedemowrite(); + if ((ps[myconnectindex].gm&MODE_GAME)) closedemowrite(); else ud.m_recstat = !ud.m_recstat; } - if ( (ps[myconnectindex].gm&MODE_GAME) && ud.m_recstat != 1 ) + if ((ps[myconnectindex].gm&MODE_GAME) && ud.m_recstat != 1) enabled = 0; gametextpal(d,yy,ud.m_recstat?((ud.m_recstat && enabled && ps[myconnectindex].gm&MODE_GAME)?"Recording":"On"):"Off",enabled?MENUHIGHLIGHT(io):15,enabled?0:1); break; case 11: @@ -2817,21 +2817,21 @@ cheat_for_port_credits: else if (m + 13 >= NUMGAMEFUNCTIONS) m = NUMGAMEFUNCTIONS-13; if (probey == gamefunc_Show_Console) currentlist = 0; - else if (KB_KeyPressed( sc_LeftArrow ) || KB_KeyPressed( sc_kpad_4 ) || - KB_KeyPressed( sc_RightArrow ) || KB_KeyPressed( sc_kpad_6 ) || - KB_KeyPressed( sc_Tab )) { + else if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || + KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || + KB_KeyPressed(sc_Tab)) { currentlist ^= 1; - KB_ClearKeyDown( sc_LeftArrow ); - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_4 ); - KB_ClearKeyDown( sc_kpad_6 ); - KB_ClearKeyDown( sc_Tab ); + KB_ClearKeyDown(sc_LeftArrow); + KB_ClearKeyDown(sc_RightArrow); + KB_ClearKeyDown(sc_kpad_4); + KB_ClearKeyDown(sc_kpad_6); + KB_ClearKeyDown(sc_Tab); sound(KICK_HIT); - } else if (KB_KeyPressed( sc_Delete )) { + } else if (KB_KeyPressed(sc_Delete)) { KeyboardKeys[probey][currentlist] = 0; - CONTROL_MapKey( probey, KeyboardKeys[probey][0], KeyboardKeys[probey][1] ); + CONTROL_MapKey(probey, KeyboardKeys[probey][0], KeyboardKeys[probey][1]); sound(KICK_HIT); - KB_ClearKeyDown( sc_Delete ); + KB_ClearKeyDown(sc_Delete); } for (l=0; l < min(13,NUMGAMEFUNCTIONS); l++) { @@ -2872,8 +2872,8 @@ cheat_for_port_credits: gametext(320>>1,90+9+9+9,"PRESS \"ESCAPE\" TO CANCEL",0,2+8+16); sc = KB_GetLastScanCode(); - if ( sc != sc_None ) { - if ( sc == sc_Escape ) { + if (sc != sc_None) { + if (sc == sc_Escape) { sound(EXITMENUSOUND); } else { sound(PISTOL_BODYHIT); @@ -2882,7 +2882,7 @@ cheat_for_port_credits: if (function == gamefunc_Show_Console) OSD_CaptureKey(KB_GetLastScanCode()); else - CONTROL_MapKey( function, KeyboardKeys[function][0], KeyboardKeys[function][1] ); + CONTROL_MapKey(function, KeyboardKeys[function][0], KeyboardKeys[function][1]); } cmenu(204); @@ -2970,7 +2970,7 @@ cheat_for_port_credits: short sense; sense = CONTROL_GetMouseSensitivity()-1; barsm(248,128,&sense,2,x==(MAXMOUSEBUTTONS-2)*2+2,MENUHIGHLIGHT((MAXMOUSEBUTTONS-2)*2+2),PHX(-7)); - CONTROL_SetMouseSensitivity( sense+1 ); + CONTROL_SetMouseSensitivity(sense+1); } if (!ud.mouseaiming) modval(0,1,(int *)&myaimmode,1,probey == (MAXMOUSEBUTTONS-2)*2+2+1); @@ -3015,10 +3015,10 @@ cheat_for_port_credits: if (function == 0) { if (whichkey < (MAXMOUSEBUTTONS-2)*2) { MouseFunctions[whichkey>>1][whichkey&1] = x; - CONTROL_MapButton( x, whichkey>>1, whichkey&1, controldevice_mouse); + CONTROL_MapButton(x, whichkey>>1, whichkey&1, controldevice_mouse); } else { MouseFunctions[whichkey-(MAXMOUSEBUTTONS-2)][0] = x; - CONTROL_MapButton( x, whichkey-(MAXMOUSEBUTTONS-2), 0, controldevice_mouse); + CONTROL_MapButton(x, whichkey-(MAXMOUSEBUTTONS-2), 0, controldevice_mouse); } cmenu(205); probey = whichkey; @@ -3030,10 +3030,10 @@ cheat_for_port_credits: } else if (function == 2) { if (whichkey < 2*joynumbuttons) { JoystickFunctions[whichkey>>1][whichkey&1] = x; - CONTROL_MapButton( x, whichkey>>1, whichkey&1, controldevice_joystick); + CONTROL_MapButton(x, whichkey>>1, whichkey&1, controldevice_joystick); } else { JoystickFunctions[joynumbuttons + (whichkey-2*joynumbuttons)][0] = x; - CONTROL_MapButton( x, joynumbuttons + (whichkey-2*joynumbuttons), 0, controldevice_joystick); + CONTROL_MapButton(x, joynumbuttons + (whichkey-2*joynumbuttons), 0, controldevice_joystick); } cmenu(207); probey = whichkey; @@ -3077,8 +3077,8 @@ cheat_for_port_credits: gametext(320>>1,31+9,tempbuf,0,2+8+16); - if (KB_KeyPressed( sc_End )) { KB_ClearKeyDown(sc_End); probey = NUMGAMEFUNCTIONS-1; sound(KICK_HIT); } - else if (KB_KeyPressed( sc_Home )) { KB_ClearKeyDown(sc_Home); probey = 0; sound(KICK_HIT); } + if (KB_KeyPressed(sc_End)) { KB_ClearKeyDown(sc_End); probey = NUMGAMEFUNCTIONS-1; sound(KICK_HIT); } + else if (KB_KeyPressed(sc_Home)) { KB_ClearKeyDown(sc_Home); probey = 0; sound(KICK_HIT); } m = probey - 6; if (m < 0) m = 0; @@ -3149,7 +3149,7 @@ cheat_for_port_credits: bar(c+160+40,46,(short *)&l,1,x==0,MENUHIGHLIGHT(0),0); l = (l<<13)-262144; if (l != MouseAnalogueScale[0]) { - CONTROL_SetAnalogAxisScale( 0, l, controldevice_mouse ); + CONTROL_SetAnalogAxisScale(0, l, controldevice_mouse); MouseAnalogueScale[0] = l; } Bsprintf(tempbuf,"%s%.2f",l>=0?" ":"",(float)l/65536.0); @@ -3160,7 +3160,7 @@ cheat_for_port_credits: bar(c+160+40,46+16,(short *)&l,1,x==1,MENUHIGHLIGHT(1),0); l = (l<<13)-262144; if (l != MouseAnalogueScale[1]) { - CONTROL_SetAnalogAxisScale( 1, l, controldevice_mouse ); + CONTROL_SetAnalogAxisScale(1, l, controldevice_mouse); MouseAnalogueScale[1] = l; } Bsprintf(tempbuf,"%s%.2f",l>=0?" ":"",(float)l/65536.0); @@ -3349,7 +3349,7 @@ cheat_for_port_credits: if (thispage == ((joynumaxes+1)/2)-1) cmenu(208); else { if (current_menu == 209) cmenu(217); - else cmenu( current_menu+1 ); + else cmenu(current_menu+1); } } break; @@ -3402,7 +3402,7 @@ cheat_for_port_credits: bar(140+56,38+8,(short *)&l,1,x==0,0,0); l = (l<<13)-262144; if (l != JoystickAnalogueScale[thispage*2]) { - CONTROL_SetAnalogAxisScale( thispage*2, l, controldevice_joystick ); + CONTROL_SetAnalogAxisScale(thispage*2, l, controldevice_joystick); JoystickAnalogueScale[thispage*2] = l; } Bsprintf(tempbuf,"%s%.2f",l>=0?" ":"",(float)l/65536.0); @@ -3426,10 +3426,10 @@ cheat_for_port_credits: minitext(140+12+72,38+15,tempbuf,0,10+16); gametext(76,38+15+15,"ANALOG",0,2+8+16); - if (CONFIG_AnalogNumToName( JoystickAnalogueAxes[thispage*2] )) { - p = CONFIG_AnalogNumToName( JoystickAnalogueAxes[thispage*2] ); + if (CONFIG_AnalogNumToName(JoystickAnalogueAxes[thispage*2])) { + p = CONFIG_AnalogNumToName(JoystickAnalogueAxes[thispage*2]); if (p) { - gametext(140+12,38+15+15, strchr(p,'_')+1, 0, 2+8+16 ); + gametext(140+12,38+15+15, strchr(p,'_')+1, 0, 2+8+16); } } @@ -3439,7 +3439,7 @@ cheat_for_port_credits: bar(140+56,38+8+64,(short *)&l,1,x==4,0,0); l = (l<<13)-262144; if (l != JoystickAnalogueScale[thispage*2+1]) { - CONTROL_SetAnalogAxisScale( thispage*2+1, l, controldevice_joystick ); + CONTROL_SetAnalogAxisScale(thispage*2+1, l, controldevice_joystick); JoystickAnalogueScale[thispage*2+1] = l; } Bsprintf(tempbuf,"%s%.2f",l>=0?" ":"",(float)l/65536.0); @@ -3463,10 +3463,10 @@ cheat_for_port_credits: minitext(140+12+72,38+15+64,tempbuf,0,10+16); gametext(76,38+64+15+15,"ANALOG",0,2+8+16); - if (CONFIG_AnalogNumToName( JoystickAnalogueAxes[thispage*2+1] )) { - p = CONFIG_AnalogNumToName( JoystickAnalogueAxes[thispage*2+1] ); + if (CONFIG_AnalogNumToName(JoystickAnalogueAxes[thispage*2+1])) { + p = CONFIG_AnalogNumToName(JoystickAnalogueAxes[thispage*2+1]); if (p) { - gametext(140+12,38+64+15+15, strchr(p,'_')+1, 0, 2+8+16 ); + gametext(140+12,38+64+15+15, strchr(p,'_')+1, 0, 2+8+16); } } } @@ -3498,7 +3498,7 @@ cheat_for_port_credits: probey = 2; break; } else if (x==2*(last-first) && joynumaxes>4) { - cmenu( (current_menu-213) == (joynumaxes/4) ? 213 : (current_menu+1) ); + cmenu((current_menu-213) == (joynumaxes/4) ? 213 : (current_menu+1)); probey = 0; break; } @@ -3539,7 +3539,7 @@ cheat_for_port_credits: c = (320>>1)-120; rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); menutext(320>>1,24,0,0,"SOUND SETUP"); - onbar = ( probey == 2 || probey == 3 ); + onbar = (probey == 2 || probey == 3); x = probe(c,50,16,7); switch (x) @@ -3562,7 +3562,7 @@ cheat_for_port_credits: if (FXDevice >= 0) { SoundToggle = 1-SoundToggle; - if ( SoundToggle == 0 ) + if (SoundToggle == 0) { FX_StopAllSounds(); clearsoundlocks(); @@ -3574,7 +3574,7 @@ cheat_for_port_credits: if (MusicDevice >= 0 && (numplayers < 2 || MusicToggle)) { MusicToggle = 1-MusicToggle; - if ( MusicToggle == 0 ) MUSIC_Pause(); + if (MusicToggle == 0) MUSIC_Pause(); else { if (ud.recstat != 2 && ps[myconnectindex].gm&MODE_GAME) @@ -3621,7 +3621,7 @@ cheat_for_port_credits: if (l != FXVolume) FXVolume <<= 2; if (l != FXVolume) - FX_SetVolume( (short) FXVolume ); + FX_SetVolume((short) FXVolume); } menutext(c,50+16,MENUHIGHLIGHT(1),(MusicDevice<0||(numplayers > 1 && !MusicToggle)),"MUSIC"); menutext(c,50+16+16+16,MENUHIGHLIGHT(3),(MusicDevice<0)||MusicToggle==0,"MUSIC VOLUME"); @@ -3634,7 +3634,7 @@ cheat_for_port_credits: MusicToggle==0||(MusicDevice<0)); MusicVolume <<= 2; if (l != MusicVolume) - MUSIC_SetVolume( (short) MusicVolume ); + MUSIC_SetVolume((short) MusicVolume); } menutext(c,50+16+16+16+16,MENUHIGHLIGHT(4),(FXDevice<0)||SoundToggle==0,"DUKE TALK"); @@ -3680,7 +3680,7 @@ cheat_for_port_credits: if (current_menu == 300) menutext(c,24,0,0,"LOAD GAME"); else menutext(c,24,0,0,"SAVE GAME"); - if (current_menu >= 360 && current_menu <= 369 ) + if (current_menu >= 360 && current_menu <= 369) { sprintf(tempbuf,"PLAYERS: %-2ld ",ud.multimode); gametext(160,156,tempbuf,0,2+8+16); @@ -3689,7 +3689,7 @@ cheat_for_port_credits: if (ud.volume_number == 0 && ud.level_number == 7) gametext(160,180,boardfilename,0,2+8+16); - x = strget((320>>1),184,&ud.savegame[current_menu-360][0],19, 999 ); + x = strget((320>>1),184,&ud.savegame[current_menu-360][0],19, 999); if (x == -1) { @@ -3703,9 +3703,9 @@ cheat_for_port_credits: goto DISPLAYNAMES; } - if ( x == 1 ) + if (x == 1) { - if ( ud.savegame[current_menu-360][0] == 0 ) + if (ud.savegame[current_menu-360][0] == 0) { KB_FlushKeyboardQueue(); cmenu(351); @@ -3740,9 +3740,9 @@ cheat_for_port_credits: if (current_menu == 300) { - if ( ud.savegame[probey][0] ) + if (ud.savegame[probey][0]) { - if ( lastprobey != probey ) + if (lastprobey != probey) { loadpheader(probey,&savehead); lastprobey = probey; @@ -3760,7 +3760,7 @@ cheat_for_port_credits: } else { - if ( ud.savegame[probey][0] ) + if (ud.savegame[probey][0]) { if (lastprobey != probey) loadpheader(probey,&savehead); @@ -3776,12 +3776,12 @@ cheat_for_port_credits: gametext(160,180,boardfilename,0,2+8+16); } - switch ( x ) + switch (x) { case -1: if (current_menu == 300) { - if ( (ps[myconnectindex].gm&MODE_GAME) != MODE_GAME) + if ((ps[myconnectindex].gm&MODE_GAME) != MODE_GAME) { cmenu(0); break; @@ -3809,14 +3809,14 @@ cheat_for_port_credits: case 7: case 8: case 9: - if ( current_menu == 300) + if (current_menu == 300) { - if ( ud.savegame[x][0] ) + if (ud.savegame[x][0]) current_menu = (1000+x); } else { - if ( ud.savegame[x][0] != 0) + if (ud.savegame[x][0] != 0) current_menu = 2000+x; else { @@ -3841,11 +3841,11 @@ DISPLAYNAMES: c = 320>>1; - if ( KB_KeyPressed( sc_LeftArrow ) || - KB_KeyPressed( sc_kpad_4 ) || - KB_KeyPressed( sc_UpArrow ) || - KB_KeyPressed( sc_PgUp ) || - KB_KeyPressed( sc_kpad_8 ) ) + if (KB_KeyPressed(sc_LeftArrow) || + KB_KeyPressed(sc_kpad_4) || + KB_KeyPressed(sc_UpArrow) || + KB_KeyPressed(sc_PgUp) || + KB_KeyPressed(sc_kpad_8)) { KB_ClearKeyDown(sc_LeftArrow); KB_ClearKeyDown(sc_kpad_4); @@ -3858,15 +3858,15 @@ DISPLAYNAMES: if (current_menu < 400) current_menu = 403; } else if ( - KB_KeyPressed( sc_PgDn ) || - KB_KeyPressed( sc_Enter ) || - KB_KeyPressed( sc_kpad_Enter ) || - KB_KeyPressed( sc_RightArrow ) || - KB_KeyPressed( sc_DownArrow ) || - KB_KeyPressed( sc_kpad_2 ) || - KB_KeyPressed( sc_kpad_9 ) || - KB_KeyPressed( sc_Space ) || - KB_KeyPressed( sc_kpad_6 ) ) + KB_KeyPressed(sc_PgDn) || + KB_KeyPressed(sc_Enter) || + KB_KeyPressed(sc_kpad_Enter) || + KB_KeyPressed(sc_RightArrow) || + KB_KeyPressed(sc_DownArrow) || + KB_KeyPressed(sc_kpad_2) || + KB_KeyPressed(sc_kpad_9) || + KB_KeyPressed(sc_Space) || + KB_KeyPressed(sc_kpad_6)) { KB_ClearKeyDown(sc_PgDn); KB_ClearKeyDown(sc_Enter); @@ -3882,7 +3882,7 @@ DISPLAYNAMES: if (current_menu > 403) current_menu = 400; } - if ( KB_KeyPressed(sc_Escape) ) + if (KB_KeyPressed(sc_Escape)) { if (ps[myconnectindex].gm&MODE_GAME) cmenu(50); @@ -3898,11 +3898,11 @@ VOLUME_ALL_40x: c = 320>>1; - if ( KB_KeyPressed( sc_LeftArrow ) || - KB_KeyPressed( sc_kpad_4 ) || - KB_KeyPressed( sc_UpArrow ) || - KB_KeyPressed( sc_PgUp ) || - KB_KeyPressed( sc_kpad_8 ) ) + if (KB_KeyPressed(sc_LeftArrow) || + KB_KeyPressed(sc_kpad_4) || + KB_KeyPressed(sc_UpArrow) || + KB_KeyPressed(sc_PgUp) || + KB_KeyPressed(sc_kpad_8)) { KB_ClearKeyDown(sc_LeftArrow); KB_ClearKeyDown(sc_kpad_4); @@ -3915,15 +3915,15 @@ VOLUME_ALL_40x: if (current_menu < 400) current_menu = 401; } else if ( - KB_KeyPressed( sc_PgDn ) || - KB_KeyPressed( sc_Enter ) || - KB_KeyPressed( sc_kpad_Enter ) || - KB_KeyPressed( sc_RightArrow ) || - KB_KeyPressed( sc_DownArrow ) || - KB_KeyPressed( sc_kpad_2 ) || - KB_KeyPressed( sc_kpad_9 ) || - KB_KeyPressed( sc_Space ) || - KB_KeyPressed( sc_kpad_6 ) ) + KB_KeyPressed(sc_PgDn) || + KB_KeyPressed(sc_Enter) || + KB_KeyPressed(sc_kpad_Enter) || + KB_KeyPressed(sc_RightArrow) || + KB_KeyPressed(sc_DownArrow) || + KB_KeyPressed(sc_kpad_2) || + KB_KeyPressed(sc_kpad_9) || + KB_KeyPressed(sc_Space) || + KB_KeyPressed(sc_kpad_6)) { KB_ClearKeyDown(sc_PgDn); KB_ClearKeyDown(sc_Enter); @@ -3939,7 +3939,7 @@ VOLUME_ALL_40x: if (current_menu > 401) current_menu = 400; } - if ( KB_KeyPressed(sc_Escape) ) + if (KB_KeyPressed(sc_Escape)) { if (ps[myconnectindex].gm&MODE_GAME) cmenu(50); @@ -3967,7 +3967,7 @@ VOLUME_ALL_40x: gametext(c,90,"Are you sure you want to quit?",0,2+8+16); gametext(c,99,"(Y/N)",0,2+8+16); - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { KB_FlushKeyboardQueue(); @@ -3979,7 +3979,7 @@ VOLUME_ALL_40x: { KB_ClearKeyDown(sc_N); quittimer = 0; - if ( ps[myconnectindex].gm&MODE_DEMO && ud.recstat == 2 ) + if (ps[myconnectindex].gm&MODE_DEMO && ud.recstat == 2) ps[myconnectindex].gm = MODE_DEMO; else { @@ -4005,7 +4005,7 @@ VOLUME_ALL_40x: gametext(c,90,"Quit to Title?",0,2+8+16); gametext(c,99,"(Y/N)",0,2+8+16); - if ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB ) + if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { KB_FlushKeyboardQueue(); ps[myconnectindex].gm = MODE_DEMO; @@ -4037,7 +4037,7 @@ VOLUME_ALL_40x: gametext(160,50,tempbuf,0,2+8+16); gametext(160,59,"to select level",0,2+8+16); - if ( KB_KeyPressed(sc_Escape) ) + if (KB_KeyPressed(sc_Escape)) { KB_ClearKeyDown(sc_Escape); sound(EXITMENUSOUND); @@ -4097,7 +4097,7 @@ VOLUME_ALL_40x: tempbuf[2] = ud.m_volume_number; tempbuf[3] = ud.m_player_skill+1; - if ( ud.m_player_skill == 3 ) ud.m_respawn_monsters = 1; + if (ud.m_player_skill == 3) ud.m_respawn_monsters = 1; else ud.m_respawn_monsters = 0; if ((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_ITEMRESPAWN)) ud.m_respawn_items = 1; @@ -4323,7 +4323,7 @@ VOLUME_ALL_40x: if (VOLUMEALL) { menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),0,"USER MAP"); - if ( boardfilename[0] != 0 ) + if (boardfilename[0] != 0) gametext(c+70+44,57+16+16+16+16+16,boardfilename,MENUHIGHLIGHT(6),2+8+16); } else { menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),1,"USER MAP"); @@ -4334,7 +4334,7 @@ VOLUME_ALL_40x: break; } - if ( (ps[myconnectindex].gm&MODE_MENU) != MODE_MENU) + if ((ps[myconnectindex].gm&MODE_MENU) != MODE_MENU) { vscrn(); cameraclock = totalclock; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index d49ae329b..6269552ef 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -120,7 +120,7 @@ int osdcmd_map(const osdfuncparm_t *parm) if (parm->numparms != 1) return OSDCMD_SHOWHELP; strcpy(filename,parm->parms[0]); - if ( strchr(filename,'.') == 0) + if (strchr(filename,'.') == 0) strcat(filename,".map"); if ((i = kopen4load(filename,0)) < 0) { @@ -655,7 +655,7 @@ int osdcmd_mpmap(const osdfuncparm_t *parm) if (parm->numparms != 1) return OSDCMD_SHOWHELP; strcpy(filename,parm->parms[0]); - if ( strchr(filename,'.') == 0) + if (strchr(filename,'.') == 0) strcat(filename,".map"); if ((i = kopen4load(filename,0)) < 0) { diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index e698f2774..38d599100 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -71,18 +71,18 @@ void incur_damage(struct player_struct *p) damage = sprite[p->i].extra - p->last_extra; - if ( damage < 0 ) + if (damage < 0) { p->extra_extra8 = 0; - if ( p->shield_amount > 0 ) + if (p->shield_amount > 0) { shield_damage = damage * (20 + (TRAND%30)) / 100; damage -= shield_damage; p->shield_amount += shield_damage; - if ( p->shield_amount < 0 ) + if (p->shield_amount < 0) { damage += p->shield_amount; p->shield_amount = 0; @@ -131,7 +131,7 @@ void tracers(long x1,long y1,long z1,long x2,long y2,long z2,long n) yv = (y2-y1)/i; zv = (z2-z1)/i; - if ( ( klabs(x1-x2)+klabs(y1-y2) ) < 3084 ) + if ((klabs(x1-x2)+klabs(y1-y2)) < 3084) return; for (i=n;i>0;i--) @@ -202,7 +202,7 @@ long hits(short i) sintable[SA&2047], 0,§,&hw,&hs,&sx,&sy,&sz,CLIPMASK1); - return ( FindDistance2D( sx-SX,sy-SY ) ); + return (FindDistance2D(sx-SX,sy-SY)); } long hitasprite(short i,short *hitsp) @@ -210,7 +210,7 @@ long hitasprite(short i,short *hitsp) long sx,sy,sz,zoff; short sect,hw; - if (badguy(&sprite[i]) ) + if (badguy(&sprite[i])) zoff = (42<<8); else if (PN == APLAYER) zoff = (39<<8); else zoff = 0; @@ -220,10 +220,10 @@ long hitasprite(short i,short *hitsp) sintable[SA&2047], 0,§,&hw,hitsp,&sx,&sy,&sz,CLIPMASK1); - if (hw >= 0 && (wall[hw].cstat&16) && badguy(&sprite[i]) ) + if (hw >= 0 && (wall[hw].cstat&16) && badguy(&sprite[i])) return((1<<30)); - return ( FindDistance2D(sx-SX,sy-SY) ); + return (FindDistance2D(sx-SX,sy-SY)); } /* @@ -251,7 +251,7 @@ long hitawall(struct player_struct *p,short *hitw) sintable[p->ang&2047], 0,§,hitw,&hs,&sx,&sy,&sz,CLIPMASK0); - return ( FindDistance2D(sx-p->posx,sy-p->posy) ); + return (FindDistance2D(sx-p->posx,sy-p->posy)); } short aim(spritetype *s,short aang,short atwith) @@ -304,22 +304,22 @@ short aim(spritetype *s,short aang,short atwith) for (k=0;k<4;k++) { - if ( j >= 0 ) + if (j >= 0) break; for (i=headspritestat[aimstats[k]];i >= 0;i=nextspritestat[i]) - if ( sprite[i].xrepeat > 0 && sprite[i].extra >= 0 && (sprite[i].cstat&(257+32768)) == 257) - if ( badguy(&sprite[i]) || k < 2 ) + if (sprite[i].xrepeat > 0 && sprite[i].extra >= 0 && (sprite[i].cstat&(257+32768)) == 257) + if (badguy(&sprite[i]) || k < 2) { if (badguy(&sprite[i]) || PN == APLAYER || PN == SHARK) { - if ( PN == APLAYER && + if (PN == APLAYER && // ud.ffire == 0 && (GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) || (GTFLAGS(GAMETYPE_FLAG_TDM) && ps[sprite[i].yvel].team == ps[s->yvel].team)) && s->picnum == APLAYER && s != &sprite[i]) continue; - if (gotshrinker && sprite[i].xrepeat < 30 ) + if (gotshrinker && sprite[i].xrepeat < 30) { if (PN == SHARK) { if (sprite[i].xrepeat < 20) continue; @@ -336,21 +336,21 @@ short aim(spritetype *s,short aang,short atwith) xv = (SX-s->x); yv = (SY-s->y); - if ( (dy1*xv) <= (dx1*yv) ) - if ( ( dy2*xv ) >= (dx2*yv) ) + if ((dy1*xv) <= (dx1*yv)) + if ((dy2*xv) >= (dx2*yv)) { sdist = mulscale(dx3,xv,14) + mulscale(dy3,yv,14); - if ( sdist > 512 && sdist < smax ) + if (sdist > 512 && sdist < smax) { if (s->picnum == APLAYER) a = (klabs(scale(SZ-s->z,10,sdist)-(ps[s->yvel].horiz+ps[s->yvel].horizoff-100)) < 100); else a = 1; - if (PN == ORGANTIC || PN == ROTATEGUN ) + if (PN == ORGANTIC || PN == ROTATEGUN) cans = cansee(SX,SY,SZ,SECT,s->x,s->y,s->z-(32<<8),s->sectnum); else cans = cansee(SX,SY,SZ-(32<<8),SECT,s->x,s->y,s->z-(32<<8),s->sectnum); - if ( a && cans ) + if (a && cans) { smax = sdist; j = i; @@ -374,7 +374,7 @@ short shoot(short i,short atwith) sect = s->sectnum; zvel = 0; - if ( s->picnum == APLAYER ) + if (s->picnum == APLAYER) { p = s->yvel; @@ -432,7 +432,7 @@ short shoot(short i,short atwith) else if (!(projectile[atwith].workslike & PROJECTILE_FLAG_NOAIM)) { j = ps[findplayer(s,&x)].i; - zvel = ( (sprite[j].z-sz)<<8 ) / (x+1); + zvel = ((sprite[j].z-sz)<<8) / (x+1); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } } @@ -449,16 +449,16 @@ short shoot(short i,short atwith) if (projectile[atwith].range == 0) projectile[atwith].range = 1024; - if ( FindDistance2D(sx-hitx,sy-hity) < projectile[atwith].range ) + if (FindDistance2D(sx-hitx,sy-hity) < projectile[atwith].range) if (FindDistance2D(wall[hitwall].x-wall[wall[hitwall].point2].x,wall[hitwall].y-wall[wall[hitwall].point2].y) > (mulscale(projectile[atwith].xrepeat+8,tilesizx[projectile[atwith].decal],3))) - if ( hitwall >= 0 && wall[hitwall].overpicnum != BIGFORCE ) - if ( ( wall[hitwall].nextsector >= 0 && hitsect >= 0 && + if (hitwall >= 0 && wall[hitwall].overpicnum != BIGFORCE) + if ((wall[hitwall].nextsector >= 0 && hitsect >= 0 && sector[wall[hitwall].nextsector].lotag == 0 && sector[hitsect].lotag == 0 && sector[wall[hitwall].nextsector].lotag == 0 && - (sector[hitsect].floorz-sector[wall[hitwall].nextsector].floorz) > (mulscale(projectile[atwith].yrepeat,tilesizy[projectile[atwith].decal],3)<<8) ) || - ( wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0 ) ) - if ( (wall[hitwall].cstat&16) == 0) + (sector[hitsect].floorz-sector[wall[hitwall].nextsector].floorz) > (mulscale(projectile[atwith].yrepeat,tilesizy[projectile[atwith].decal],3)<<8)) || + (wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0)) + if ((wall[hitwall].cstat&16) == 0) { if (wall[hitwall].nextsector >= 0) { @@ -471,8 +471,8 @@ short shoot(short i,short atwith) } } - if ( wall[hitwall].nextwall >= 0 && - wall[wall[hitwall].nextwall].hitag != 0 ) + if (wall[hitwall].nextwall >= 0 && + wall[wall[hitwall].nextwall].hitag != 0) return -1; if (wall[hitwall].hitag == 0) @@ -553,7 +553,7 @@ short shoot(short i,short atwith) if ((projectile[atwith].range == 0) && (projectile[atwith].workslike & PROJECTILE_FLAG_KNEE)) projectile[atwith].range = 1024; - if ( (projectile[atwith].range > 0) && (( klabs(sx-hitx)+klabs(sy-hity) ) > projectile[atwith].range) ) + if ((projectile[atwith].range > 0) && ((klabs(sx-hitx)+klabs(sy-hity)) > projectile[atwith].range)) return -1; else { @@ -577,23 +577,23 @@ short shoot(short i,short atwith) if (projectile[atwith].sound > -1) spritesound(projectile[atwith].sound,j); } - if ( p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400 ) + if (p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400) sprite[j].extra += (max_player_health>>2); - if ( hitspr >= 0 && sprite[hitspr].picnum != ACCESSSWITCH && sprite[hitspr].picnum != ACCESSSWITCH2 ) + if (hitspr >= 0 && sprite[hitspr].picnum != ACCESSSWITCH && sprite[hitspr].picnum != ACCESSSWITCH2) { checkhitsprite(hitspr,j); if (p >= 0) checkhitswitch(p,hitspr,1); } - else if ( hitwall >= 0 ) + else if (hitwall >= 0) { - if ( wall[hitwall].cstat&2 ) + if (wall[hitwall].cstat&2) if (wall[hitwall].nextsector >= 0) - if (hitz >= (sector[wall[hitwall].nextsector].floorz) ) + if (hitz >= (sector[wall[hitwall].nextsector].floorz)) hitwall = wall[hitwall].nextwall; - if ( hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2 ) + if (hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2) { checkhitwall(j,hitwall,hitx,hity,hitz,atwith); if (p >= 0) checkhitswitch(p,hitwall,0); @@ -617,7 +617,7 @@ short shoot(short i,short atwith) if (projectile[atwith].workslike & PROJECTILE_FLAG_HITSCAN) { - if ( s->extra >= 0 ) s->shade = projectile[atwith].shade; + if (s->extra >= 0) s->shade = projectile[atwith].shade; if (p >= 0) { @@ -627,19 +627,19 @@ short shoot(short i,short atwith) SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)+(5<<8); - if (((sprite[j].picnum >= GREENSLIME)&&(sprite[j].picnum <= GREENSLIME+7))||(sprite[j].picnum ==ROTATEGUN) ) + if (((sprite[j].picnum >= GREENSLIME)&&(sprite[j].picnum <= GREENSLIME+7))||(sprite[j].picnum ==ROTATEGUN)) { dal -= (8<<8); return -1; } - zvel = ( ( sprite[j].z-sz-dal )<<8 ) / ldist(&sprite[ps[p].i], &sprite[j]) ; + zvel = ((sprite[j].z-sz-dal)<<8) / ldist(&sprite[ps[p].i], &sprite[j]) ; sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } @@ -664,7 +664,7 @@ short shoot(short i,short atwith) { j = findplayer(s,&x); sz -= (4<<8); - zvel = ( (ps[j].posz-sz) <<8 ) / (ldist(&sprite[ps[j].i], s ) ); + zvel = ((ps[j].posz-sz) <<8) / (ldist(&sprite[ps[j].i], s)); if (s->picnum != BOSS1) { zvel += 128-(TRAND&255); @@ -692,14 +692,14 @@ short shoot(short i,short atwith) if (hitsect < 0) return -1; - if ( (projectile[atwith].range > 0) && (( klabs(sx-hitx)+klabs(sy-hity) ) > projectile[atwith].range) ) return -1; + if ((projectile[atwith].range > 0) && ((klabs(sx-hitx)+klabs(sy-hity)) > projectile[atwith].range)) return -1; if (projectile[atwith].trail > -1) hitscantrail(sx,sy,sz,hitx,hity,hitz,sa,atwith); if (projectile[atwith].workslike & PROJECTILE_FLAG_WATERBUBBLES) { - if ( (TRAND&15) == 0 && sector[hitsect].lotag == 2 ) + if ((TRAND&15) == 0 && sector[hitsect].lotag == 2) tracers(hitx,hity,hitz,sx,sy,sz,8-(ud.multimode>>1)); } @@ -715,11 +715,11 @@ short shoot(short i,short atwith) if (projectile[atwith].extra_rand > 0) sprite[k].extra += (TRAND%projectile[atwith].extra_rand); - if ( hitwall == -1 && hitspr == -1) + if (hitwall == -1 && hitspr == -1) { - if ( zvel < 0 ) + if (zvel < 0) { - if ( sector[hitsect].ceilingstat&1 ) + if (sector[hitsect].ceilingstat&1) { sprite[k].xrepeat = 0; sprite[k].yrepeat = 0; @@ -742,7 +742,7 @@ short shoot(short i,short atwith) if (hitspr >= 0) { checkhitsprite(hitspr,k); - if ( sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && ps[sprite[hitspr].yvel].team != ps[sprite[i].yvel].team))) + if (sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && ps[sprite[hitspr].yvel].team != ps[sprite[i].yvel].team))) { l = spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -770,13 +770,13 @@ short shoot(short i,short atwith) sprite[hitspr].picnum == DIPSWITCH3 || sprite[hitspr].picnum == DIPSWITCH3+1 || sprite[hitspr].picnum == HANDSWITCH || - sprite[hitspr].picnum == HANDSWITCH+1) ) + sprite[hitspr].picnum == HANDSWITCH+1)) { checkhitswitch(p,hitspr,1); return -1; } } - else if ( hitwall >= 0 ) + else if (hitwall >= 0) { if (projectile[atwith].spawns >= 0) { @@ -787,7 +787,7 @@ short shoot(short i,short atwith) hittype[wh].temp_data[7] = hitsect; hittype[wh].temp_data[8] = hitspr; } - if ( isadoorwall(wall[hitwall].picnum) == 1 ) + if (isadoorwall(wall[hitwall].picnum) == 1) goto DOSKIPBULLETHOLE; if (p >= 0 && ( wall[hitwall].picnum == DIPSWITCH || @@ -797,20 +797,20 @@ short shoot(short i,short atwith) wall[hitwall].picnum == DIPSWITCH3 || wall[hitwall].picnum == DIPSWITCH3+1 || wall[hitwall].picnum == HANDSWITCH || - wall[hitwall].picnum == HANDSWITCH+1) ) + wall[hitwall].picnum == HANDSWITCH+1)) { checkhitswitch(p,hitwall,0); return -1; } - if (wall[hitwall].hitag != 0 || ( wall[hitwall].nextwall >= 0 && wall[wall[hitwall].nextwall].hitag != 0 ) ) + if (wall[hitwall].hitag != 0 || (wall[hitwall].nextwall >= 0 && wall[wall[hitwall].nextwall].hitag != 0)) goto DOSKIPBULLETHOLE; - if ( hitsect >= 0 && sector[hitsect].lotag == 0 ) - if ( wall[hitwall].overpicnum != BIGFORCE ) - if ( (wall[hitwall].nextsector >= 0 && sector[wall[hitwall].nextsector].lotag == 0 ) || - ( wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0 ) ) - if ( (wall[hitwall].cstat&16) == 0) + if (hitsect >= 0 && sector[hitsect].lotag == 0) + if (wall[hitwall].overpicnum != BIGFORCE) + if ((wall[hitwall].nextsector >= 0 && sector[wall[hitwall].nextsector].lotag == 0) || + (wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0)) + if ((wall[hitwall].cstat&16) == 0) { if (wall[hitwall].nextsector >= 0) { @@ -827,7 +827,7 @@ short shoot(short i,short atwith) while (l >= 0) { if (sprite[l].picnum == projectile[atwith].decal) - if (dist(&sprite[l],&sprite[k]) < (12+(TRAND&7)) ) + if (dist(&sprite[l],&sprite[k]) < (12+(TRAND&7))) goto DOSKIPBULLETHOLE; l = nextspritestat[l]; } @@ -861,9 +861,9 @@ short shoot(short i,short atwith) DOSKIPBULLETHOLE: - if ( wall[hitwall].cstat&2 ) + if (wall[hitwall].cstat&2) if (wall[hitwall].nextsector >= 0) - if (hitz >= (sector[wall[hitwall].nextsector].floorz) ) + if (hitz >= (sector[wall[hitwall].nextsector].floorz)) hitwall = wall[hitwall].nextwall; checkhitwall(k,hitwall,hitx,hity,hitz,atwith); @@ -878,10 +878,10 @@ DOSKIPBULLETHOLE: hittype[k].temp_data[7] = hitsect; hittype[k].temp_data[8] = hitspr; - if ( hitspr >= 0 ) + if (hitspr >= 0) { checkhitsprite(hitspr,k); - if ( sprite[hitspr].picnum != APLAYER ) + if (sprite[hitspr].picnum != APLAYER) { if (projectile[atwith].spawns >= 0) { @@ -895,11 +895,11 @@ DOSKIPBULLETHOLE: } else sprite[k].xrepeat = sprite[k].yrepeat = 0; } - else if ( hitwall >= 0 ) + else if (hitwall >= 0) checkhitwall(k,hitwall,hitx,hity,hitz,atwith); } - if ( (TRAND&255) < 4 ) + if ((TRAND&255) < 4) if (projectile[atwith].isound >= 0) xyzsound(projectile[atwith].isound,k,hitx,hity,hitz); @@ -912,7 +912,7 @@ DOSKIPBULLETHOLE: /* if(projectile[atwith].workslike & PROJECTILE_FLAG_FREEZEBLAST) sz += (3<<8);*/ - if ( s->extra >= 0 ) s->shade = projectile[atwith].shade; + if (s->extra >= 0) s->shade = projectile[atwith].shade; scount = 1; vel = projectile[atwith].vel; @@ -925,15 +925,15 @@ DOSKIPBULLETHOLE: SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)+(8<<8); - zvel = ( (sprite[j].z-sz-dal)*vel ) / ldist(&sprite[ps[p].i], &sprite[j]); - if ( sprite[j].picnum != RECON ) + zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[ps[p].i], &sprite[j]); + if (sprite[j].picnum != RECON) sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } // else zvel = (100-ps[p].horiz-ps[p].horizoff)*81; @@ -948,16 +948,16 @@ DOSKIPBULLETHOLE: sa = getangle(ps[j].oposx-sx,ps[j].oposy-sy); l = ldist(&sprite[ps[j].i],s); - zvel = ( (ps[j].oposz-sz)*vel) / l; + zvel = ((ps[j].oposz-sz)*vel) / l; - if ( badguy(s) && (s->hitag&face_player_smart) ) + if (badguy(s) && (s->hitag&face_player_smart)) sa = s->ang+(TRAND&31)-16; } } - if ( p >= 0 && j >= 0) + if (p >= 0 && j >= 0) l = j; else l = -1; @@ -1028,7 +1028,7 @@ DOSKIPBULLETHOLE: else sa += 1024 + 64 - (TRAND&127); zvel = 1024-(TRAND&2047); case KNEE__STATIC: - if (atwith == KNEE ) + if (atwith == KNEE) { if (p >= 0) { @@ -1039,7 +1039,7 @@ DOSKIPBULLETHOLE: else { j = ps[findplayer(s,&x)].i; - zvel = ( (sprite[j].z-sz)<<8 ) / (x+1); + zvel = ((sprite[j].z-sz)<<8) / (x+1); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } } @@ -1051,17 +1051,17 @@ DOSKIPBULLETHOLE: sintable[sa&2047],zvel<<6, &hitsect,&hitwall,&hitspr,&hitx,&hity,&hitz,CLIPMASK1); - if ( atwith == BLOODSPLAT1 || atwith == BLOODSPLAT2 || atwith == BLOODSPLAT3 || atwith == BLOODSPLAT4 ) + if (atwith == BLOODSPLAT1 || atwith == BLOODSPLAT2 || atwith == BLOODSPLAT3 || atwith == BLOODSPLAT4) { - if ( FindDistance2D(sx-hitx,sy-hity) < 1024 ) - if ( hitwall >= 0 && wall[hitwall].overpicnum != BIGFORCE ) - if ( ( wall[hitwall].nextsector >= 0 && hitsect >= 0 && + if (FindDistance2D(sx-hitx,sy-hity) < 1024) + if (hitwall >= 0 && wall[hitwall].overpicnum != BIGFORCE) + if ((wall[hitwall].nextsector >= 0 && hitsect >= 0 && sector[wall[hitwall].nextsector].lotag == 0 && sector[hitsect].lotag == 0 && sector[wall[hitwall].nextsector].lotag == 0 && - (sector[hitsect].floorz-sector[wall[hitwall].nextsector].floorz) > (16<<8) ) || - ( wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0 ) ) - if ( (wall[hitwall].cstat&16) == 0) + (sector[hitsect].floorz-sector[wall[hitwall].nextsector].floorz) > (16<<8)) || + (wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0)) + if ((wall[hitwall].cstat&16) == 0) { if (wall[hitwall].nextsector >= 0) { @@ -1074,8 +1074,8 @@ DOSKIPBULLETHOLE: } } - if ( wall[hitwall].nextwall >= 0 && - wall[wall[hitwall].nextwall].hitag != 0 ) + if (wall[hitwall].nextwall >= 0 && + wall[wall[hitwall].nextwall].hitag != 0) return -1; if (wall[hitwall].hitag == 0) @@ -1090,7 +1090,7 @@ DOSKIPBULLETHOLE: sprite[k].cstat |= (TRAND&4); ssp(k,CLIPMASK0); setsprite(k,sprite[k].x,sprite[k].y,sprite[k].z); - if ( PN == OOZFILTER || PN == NEWBEAST ) + if (PN == OOZFILTER || PN == NEWBEAST) sprite[k].pal = 6; } } @@ -1099,7 +1099,7 @@ DOSKIPBULLETHOLE: if (hitsect < 0) break; - if ( ( klabs(sx-hitx)+klabs(sy-hity) ) < 1024 ) + if ((klabs(sx-hitx)+klabs(sy-hity)) < 1024) { if (hitwall >= 0 || hitspr >= 0) { @@ -1115,23 +1115,23 @@ DOSKIPBULLETHOLE: hittype[k].temp_data[8] = hitspr; } - if ( p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400 ) + if (p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400) sprite[j].extra += (max_player_health>>2); - if ( hitspr >= 0 && sprite[hitspr].picnum != ACCESSSWITCH && sprite[hitspr].picnum != ACCESSSWITCH2 ) + if (hitspr >= 0 && sprite[hitspr].picnum != ACCESSSWITCH && sprite[hitspr].picnum != ACCESSSWITCH2) { checkhitsprite(hitspr,j); if (p >= 0) checkhitswitch(p,hitspr,1); } - else if ( hitwall >= 0 ) + else if (hitwall >= 0) { - if ( wall[hitwall].cstat&2 ) + if (wall[hitwall].cstat&2) if (wall[hitwall].nextsector >= 0) - if (hitz >= (sector[wall[hitwall].nextsector].floorz) ) + if (hitz >= (sector[wall[hitwall].nextsector].floorz)) hitwall = wall[hitwall].nextwall; - if ( hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2 ) + if (hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2) { checkhitwall(j,hitwall,hitx,hity,hitz,atwith); if (p >= 0) checkhitswitch(p,hitwall,0); @@ -1157,7 +1157,7 @@ DOSKIPBULLETHOLE: case SHOTGUN__STATIC: case CHAINGUN__STATIC: - if ( s->extra >= 0 ) s->shade = -96; + if (s->extra >= 0) s->shade = -96; if (p >= 0) { @@ -1167,9 +1167,9 @@ DOSKIPBULLETHOLE: SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { @@ -1179,7 +1179,7 @@ DOSKIPBULLETHOLE: dal -= (8<<8); } - zvel = ( ( sprite[j].z-sz-dal )<<8 ) / ldist(&sprite[ps[p].i], &sprite[j]) ; + zvel = ((sprite[j].z-sz-dal)<<8) / ldist(&sprite[ps[p].i], &sprite[j]) ; sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } @@ -1204,7 +1204,7 @@ DOSKIPBULLETHOLE: { j = findplayer(s,&x); sz -= (4<<8); - zvel = ( (ps[j].posz-sz) <<8 ) / (ldist(&sprite[ps[j].i], s ) ); + zvel = ((ps[j].posz-sz) <<8) / (ldist(&sprite[ps[j].i], s)); if (s->picnum != BOSS1) { zvel += 128-(TRAND&255); @@ -1227,7 +1227,7 @@ DOSKIPBULLETHOLE: if (hitsect < 0) return -1; - if ( (TRAND&15) == 0 && sector[hitsect].lotag == 2 ) + if ((TRAND&15) == 0 && sector[hitsect].lotag == 2) tracers(hitx,hity,hitz,sx,sy,sz,8-(ud.multimode>>1)); if (p >= 0) @@ -1241,11 +1241,11 @@ DOSKIPBULLETHOLE: hittype[k].temp_data[8] = hitspr; - if ( hitwall == -1 && hitspr == -1) + if (hitwall == -1 && hitspr == -1) { - if ( zvel < 0 ) + if (zvel < 0) { - if ( sector[hitsect].ceilingstat&1 ) + if (sector[hitsect].ceilingstat&1) { sprite[k].xrepeat = 0; sprite[k].yrepeat = 0; @@ -1263,7 +1263,7 @@ DOSKIPBULLETHOLE: if (hitspr >= 0) { checkhitsprite(hitspr,k); - if ( sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && ps[sprite[hitspr].yvel].team != ps[sprite[i].yvel].team))) + if (sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && ps[sprite[hitspr].yvel].team != ps[sprite[i].yvel].team))) { l = spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -1288,20 +1288,20 @@ DOSKIPBULLETHOLE: sprite[hitspr].picnum == DIPSWITCH3 || sprite[hitspr].picnum == DIPSWITCH3+1 || sprite[hitspr].picnum == HANDSWITCH || - sprite[hitspr].picnum == HANDSWITCH+1) ) + sprite[hitspr].picnum == HANDSWITCH+1)) { checkhitswitch(p,hitspr,1); return -1; } } - else if ( hitwall >= 0 ) + else if (hitwall >= 0) { l = spawn(k,SMALLSMOKE); hittype[l].temp_data[6] = hitwall; hittype[l].temp_data[7] = hitsect; hittype[l].temp_data[8] = hitspr; - if ( isadoorwall(wall[hitwall].picnum) == 1 ) + if (isadoorwall(wall[hitwall].picnum) == 1) goto SKIPBULLETHOLE; if (p >= 0 && ( wall[hitwall].picnum == DIPSWITCH || @@ -1311,20 +1311,20 @@ DOSKIPBULLETHOLE: wall[hitwall].picnum == DIPSWITCH3 || wall[hitwall].picnum == DIPSWITCH3+1 || wall[hitwall].picnum == HANDSWITCH || - wall[hitwall].picnum == HANDSWITCH+1) ) + wall[hitwall].picnum == HANDSWITCH+1)) { checkhitswitch(p,hitwall,0); return -1; } - if (wall[hitwall].hitag != 0 || ( wall[hitwall].nextwall >= 0 && wall[wall[hitwall].nextwall].hitag != 0 ) ) + if (wall[hitwall].hitag != 0 || (wall[hitwall].nextwall >= 0 && wall[wall[hitwall].nextwall].hitag != 0)) goto SKIPBULLETHOLE; - if ( hitsect >= 0 && sector[hitsect].lotag == 0 ) - if ( wall[hitwall].overpicnum != BIGFORCE ) - if ( (wall[hitwall].nextsector >= 0 && sector[wall[hitwall].nextsector].lotag == 0 ) || - ( wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0 ) ) - if ( (wall[hitwall].cstat&16) == 0) + if (hitsect >= 0 && sector[hitsect].lotag == 0) + if (wall[hitwall].overpicnum != BIGFORCE) + if ((wall[hitwall].nextsector >= 0 && sector[wall[hitwall].nextsector].lotag == 0) || + (wall[hitwall].nextsector == -1 && sector[hitsect].lotag == 0)) + if ((wall[hitwall].cstat&16) == 0) { if (wall[hitwall].nextsector >= 0) { @@ -1341,7 +1341,7 @@ DOSKIPBULLETHOLE: while (l >= 0) { if (sprite[l].picnum == BULLETHOLE) - if (dist(&sprite[l],&sprite[k]) < (12+(TRAND&7)) ) + if (dist(&sprite[l],&sprite[k]) < (12+(TRAND&7))) goto SKIPBULLETHOLE; l = nextspritestat[l]; } @@ -1361,9 +1361,9 @@ DOSKIPBULLETHOLE: SKIPBULLETHOLE: - if ( wall[hitwall].cstat&2 ) + if (wall[hitwall].cstat&2) if (wall[hitwall].nextsector >= 0) - if (hitz >= (sector[wall[hitwall].nextsector].floorz) ) + if (hitz >= (sector[wall[hitwall].nextsector].floorz)) hitwall = wall[hitwall].nextwall; checkhitwall(k,hitwall,hitx,hity,hitz,SHOTSPARK1); @@ -1378,10 +1378,10 @@ SKIPBULLETHOLE: hittype[k].temp_data[7] = hitsect; hittype[k].temp_data[8] = hitspr; - if ( hitspr >= 0 ) + if (hitspr >= 0) { checkhitsprite(hitspr,k); - if ( sprite[hitspr].picnum != APLAYER ) + if (sprite[hitspr].picnum != APLAYER) { l = spawn(k,SMALLSMOKE); hittype[l].temp_data[6] = hitwall; @@ -1390,11 +1390,11 @@ SKIPBULLETHOLE: } else sprite[k].xrepeat = sprite[k].yrepeat = 0; } - else if ( hitwall >= 0 ) + else if (hitwall >= 0) checkhitwall(k,hitwall,hitx,hity,hitz,SHOTSPARK1); } - if ( (TRAND&255) < 4 ) + if ((TRAND&255) < 4) xyzsound(PISTOL_RICOCHET,k,hitx,hity,hitz); return -1; @@ -1403,7 +1403,7 @@ SKIPBULLETHOLE: case SPIT__STATIC: case COOLEXPLOSION1__STATIC: - if ( s->extra >= 0 ) s->shade = -96; + if (s->extra >= 0) s->shade = -96; scount = 1; if (atwith == SPIT) vel = 292; @@ -1428,15 +1428,15 @@ SKIPBULLETHOLE: SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)-(12<<8); - zvel = ((sprite[j].z-sz-dal)*vel ) / ldist(&sprite[ps[p].i], &sprite[j]) ; + zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[ps[p].i], &sprite[j]) ; sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } else @@ -1447,7 +1447,7 @@ SKIPBULLETHOLE: j = findplayer(s,&x); // sa = getangle(ps[j].oposx-sx,ps[j].oposy-sy); sa += 16-(TRAND&31); - zvel = ( ( (ps[j].oposz - sz + (3<<8) ) )*vel ) / ldist(&sprite[ps[j].i],s); + zvel = (((ps[j].oposz - sz + (3<<8)))*vel) / ldist(&sprite[ps[j].i],s); } if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; oldzvel = zvel; @@ -1455,7 +1455,7 @@ SKIPBULLETHOLE: if (atwith == SPIT) { sizx = 18;sizy = 18,sz -= (10<<8); } else { - if ( atwith == FIRELASER ) + if (atwith == FIRELASER) { if (p >= 0) { @@ -1511,7 +1511,7 @@ SKIPBULLETHOLE: sz += (3<<8); case RPG__STATIC: - if ( s->extra >= 0 ) s->shade = -96; + if (s->extra >= 0) s->shade = -96; scount = 1; vel = 644; @@ -1524,16 +1524,16 @@ SKIPBULLETHOLE: SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)+(8<<8); - zvel = ( (sprite[j].z-sz-dal)*vel ) / ldist(&sprite[ps[p].i], &sprite[j]); - if ( sprite[j].picnum != RECON ) + zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[ps[p].i], &sprite[j]); + if (sprite[j].picnum != RECON) sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } else zvel = (100-ps[p].horiz-ps[p].horizoff)*81; @@ -1554,13 +1554,13 @@ SKIPBULLETHOLE: } l = ldist(&sprite[ps[j].i],s); - zvel = ( (ps[j].oposz-sz)*vel) / l; + zvel = ((ps[j].oposz-sz)*vel) / l; - if ( badguy(s) && (s->hitag&face_player_smart) ) + if (badguy(s) && (s->hitag&face_player_smart)) sa = s->ang+(TRAND&31)-16; } - if ( p >= 0 && j >= 0) + if (p >= 0 && j >= 0) l = j; else l = -1; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; @@ -1621,7 +1621,7 @@ SKIPBULLETHOLE: sprite[j].ang += 16-(TRAND&31); sprite[j].zvel += 256-(TRAND&511); - if ( ps[p].hbomb_hold_delay ) + if (ps[p].hbomb_hold_delay) { sprite[j].x -= sintable[sa&2047]/644; sprite[j].y -= sintable[(sa+1024+512)&2047]/644; @@ -1658,14 +1658,14 @@ SKIPBULLETHOLE: if (hitspr >= 0) break; if (hitwall >= 0 && hitsect >= 0) - if ( ((hitx-sx)*(hitx-sx)+(hity-sy)*(hity-sy)) < (290*290) ) + if (((hitx-sx)*(hitx-sx)+(hity-sy)*(hity-sy)) < (290*290)) { - if ( wall[hitwall].nextsector >= 0) + if (wall[hitwall].nextsector >= 0) { - if ( sector[wall[hitwall].nextsector].lotag <= 2 && sector[hitsect].lotag <= 2 ) + if (sector[wall[hitwall].nextsector].lotag <= 2 && sector[hitsect].lotag <= 2) j = 1; } - else if ( sector[hitsect].lotag <= 2 ) + else if (sector[hitsect].lotag <= 2) j = 1; } @@ -1699,7 +1699,7 @@ SKIPBULLETHOLE: case BOUNCEMINE__STATIC: case MORTER__STATIC: - if ( s->extra >= 0 ) s->shade = -96; + if (s->extra >= 0) s->shade = -96; j = ps[findplayer(s,&x)].i; x = ldist(&sprite[j],s); @@ -1724,19 +1724,19 @@ SKIPBULLETHOLE: SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)+(5<<8); - if (((sprite[j].picnum >= GREENSLIME)&&(sprite[j].picnum <= GREENSLIME+7))||(sprite[j].picnum ==ROTATEGUN) ) { + if (((sprite[j].picnum >= GREENSLIME)&&(sprite[j].picnum <= GREENSLIME+7))||(sprite[j].picnum ==ROTATEGUN)) { dal -= (8<<8); } - zvel = ( ( sprite[j].z-sz-dal )<<8 ) / (ldist(&sprite[ps[p].i], &sprite[j]) ); + zvel = ((sprite[j].z-sz-dal)<<8) / (ldist(&sprite[ps[p].i], &sprite[j])); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } else @@ -1752,7 +1752,7 @@ SKIPBULLETHOLE: { j = findplayer(s,&x); sz -= (4<<8); - zvel = ( (ps[j].posz-sz) <<8 ) / (ldist(&sprite[ps[j].i], s ) ); + zvel = ((ps[j].posz-sz) <<8) / (ldist(&sprite[ps[j].i], s)); zvel += 128-(TRAND&255); sa += 32-(TRAND&63); } @@ -1776,13 +1776,13 @@ SKIPBULLETHOLE: sprite[j].cstat |= 130; sprite[j].xrepeat = sprite[j].yrepeat = 1; - if ( hitwall == -1 && hitspr == -1 && hitsect >= 0) + if (hitwall == -1 && hitspr == -1 && hitsect >= 0) { - if ( zvel < 0 && (sector[hitsect].ceilingstat&1) == 0) + if (zvel < 0 && (sector[hitsect].ceilingstat&1) == 0) checkhitceiling(hitsect); } else if (hitspr >= 0) checkhitsprite(hitspr,j); - else if (hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2 ) + else if (hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2) { /* if(wall[hitwall].overpicnum == MIRROR && k == 0) { @@ -1808,22 +1808,22 @@ SKIPBULLETHOLE: break; case SHRINKER__STATIC: - if ( s->extra >= 0 ) s->shade = -96; + if (s->extra >= 0) s->shade = -96; if (p >= 0) { // j = aim( s, AUTO_AIM_ANGLE ); SetGameVarID(g_iAimAngleVarID,AUTO_AIM_ANGLE,i,p); OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1); j=-1; - if ( GetGameVarID(g_iAimAngleVarID,i,p) > 0 ) + if (GetGameVarID(g_iAimAngleVarID,i,p) > 0) { - j = aim( s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); + j = aim(s, GetGameVarID(g_iAimAngleVarID,i,p),atwith); } if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1); - zvel = ( (sprite[j].z-sz-dal-(4<<8))*768) / (ldist( &sprite[ps[p].i], &sprite[j])); + zvel = ((sprite[j].z-sz-dal-(4<<8))*768) / (ldist(&sprite[ps[p].i], &sprite[j])); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } else zvel = (100-ps[p].horiz-ps[p].horizoff)*98; @@ -1832,7 +1832,7 @@ SKIPBULLETHOLE: { j = findplayer(s,&x); l = ldist(&sprite[ps[j].i],s); - zvel = ( (ps[j].oposz-sz)*512) / l ; + zvel = ((ps[j].oposz-sz)*512) / l ; } else zvel = 0; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; @@ -1987,7 +1987,7 @@ void DoFire(struct player_struct *p) shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]); } - if (! (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE )) + if (!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE)) { lastvisinc = totalclock+32; p->visibility = 0; @@ -2015,7 +2015,7 @@ void DoSpawn(struct player_struct *p) j = spawn(p->i, aplWeaponSpawn[p->curr_weapon][snum]); - if ((aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SPAWNTYPE3 ) ) + if ((aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SPAWNTYPE3)) { // like chaingun shells sprite[j].ang += 1024; @@ -2145,17 +2145,17 @@ void displayweapon(short snum) gs = sprite[p->i].shade; if (gs > 24) gs = 24; - if (p->newowner >= 0 || ud.camerasprite >= 0 || p->over_shoulder_on > 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0) || animatefist(gs,snum) || animateknuckles(gs,snum) || animatetip(gs,snum) || animateaccess(gs,snum) ) + if (p->newowner >= 0 || ud.camerasprite >= 0 || p->over_shoulder_on > 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0) || animatefist(gs,snum) || animateknuckles(gs,snum) || animatetip(gs,snum) || animateaccess(gs,snum)) return; animateknee(gs,snum); gun_pos = 80-(p->weapon_pos*p->weapon_pos); - weapon_xoffset = (160)-90; + weapon_xoffset = (160)-90; weapon_xoffset -= (sintable[((p->weapon_sway>>1)+512)&2047]/(1024+512)); weapon_xoffset -= 58 + p->weapon_ang; - if ( sprite[p->i].xrepeat < 32 ) + if (sprite[p->i].xrepeat < 32) gun_pos -= klabs(sintable[(p->weapon_sway<<2)&2047]>>9); else gun_pos -= klabs(sintable[(p->weapon_sway>>1)&2047]>>10); @@ -2192,16 +2192,16 @@ void displayweapon(short snum) } - if ( j < 6 || j > 12 ) + if (j < 6 || j > 12) myospal(weapon_xoffset+80-(p->look_ang>>1), looking_arc+250-gun_pos,KNEE,gs,o|4,pal); else myospal(weapon_xoffset+160-16-(p->look_ang>>1), looking_arc+214-gun_pos,KNEE+1,gs,o|4,pal); } - if ( sprite[p->i].xrepeat < 40 ) + if (sprite[p->i].xrepeat < 40) { - if (p->jetpack_on == 0 ) + if (p->jetpack_on == 0) { i = sprite[p->i].xvel; looking_arc += 32-(i>>1); @@ -2228,7 +2228,7 @@ void displayweapon(short snum) OnEvent(EVENT_DRAWWEAPON,ps[screenpeek].i,screenpeek, -1); if (GetGameVarID(g_iReturnVarID,ps[screenpeek].i,screenpeek) == 0) { - if ( (*kb) > 0 ) + if ((*kb) > 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2239,7 +2239,7 @@ void displayweapon(short snum) pal = p->palookup; } - if ( (*kb) < 5 || (*kb) > 9 ) + if ((*kb) < 5 || (*kb) > 9) myospal(weapon_xoffset+220-(p->look_ang>>1), looking_arc+250-gun_pos,KNEE,gs,o,pal); else @@ -2339,7 +2339,7 @@ void displayweapon(short snum) case 10: case 11: case 12: - if ( *kb > 1 && *kb < 5 ) + if (*kb > 1 && *kb < 5) { gun_pos -= 40; weapon_xoffset += 20; @@ -2451,7 +2451,7 @@ void displayweapon(short snum) else pal = sector[p->cursectnum].floorpal; - if ( (*kb) < *aplWeaponTotalTime[PISTOL_WEAPON]+1) + if ((*kb) < *aplWeaponTotalTime[PISTOL_WEAPON]+1) { short kb_frames[] = {0,1,2},l; @@ -2570,12 +2570,12 @@ void displayweapon(short snum) if (p->hbomb_hold_delay) { - myospalw( (cycloidy[*kb]>>1)+weapon_xoffset+268-(p->look_ang>>1),cycloidy[*kb]+looking_arc+238-gun_pos,DEVISTATOR+i,-32,o,pal); + myospalw((cycloidy[*kb]>>1)+weapon_xoffset+268-(p->look_ang>>1),cycloidy[*kb]+looking_arc+238-gun_pos,DEVISTATOR+i,-32,o,pal); myospalw(weapon_xoffset+30-(p->look_ang>>1),looking_arc+240-gun_pos,DEVISTATOR,gs,o|4,pal); } else { - myospalw( -(cycloidy[*kb]>>1)+weapon_xoffset+30-(p->look_ang>>1),cycloidy[*kb]+looking_arc+240-gun_pos,DEVISTATOR+i,-32,o|4,pal); + myospalw(-(cycloidy[*kb]>>1)+weapon_xoffset+30-(p->look_ang>>1),cycloidy[*kb]+looking_arc+240-gun_pos,DEVISTATOR+i,-32,o|4,pal); myospalw(weapon_xoffset+268-(p->look_ang>>1),looking_arc+238-gun_pos,DEVISTATOR,gs,o,pal); } } @@ -2734,9 +2734,9 @@ void getinput(short snum) momx = momy = 0; p = &ps[snum]; - if ( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) ) + if ((p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause))) { - CONTROL_GetInput( &info ); + CONTROL_GetInput(&info); memset(&lastinfo, 0, sizeof(lastinfo)); loc.fvel = vel = 0; loc.svel = svel = 0; @@ -2770,7 +2770,7 @@ void getinput(short snum) } } - CONTROL_GetInput( &info ); + CONTROL_GetInput(&info); if (MouseFilter) { @@ -2822,17 +2822,17 @@ void getinput(short snum) if (BUTTON(gamefunc_Jump) && p->on_ground) jump_input = 4; - loc.bits = (jump_input > 0 || BUTTON(gamefunc_Jump)); //BUTTON(gamefunc_Jump); + loc.bits = (jump_input > 0 || BUTTON(gamefunc_Jump)); //BUTTON(gamefunc_Jump); loc.bits |= BUTTON(gamefunc_Crouch)<<1; loc.bits |= BUTTON(gamefunc_Fire)<<2; loc.bits |= BUTTON(gamefunc_Aim_Up)<<3; loc.bits |= BUTTON(gamefunc_Aim_Down)<<4; - if (ud.runkey_mode) loc.bits |= (ud.auto_run | BUTTON(gamefunc_Run))<<5; - else loc.bits |= (BUTTON(gamefunc_Run) ^ ud.auto_run)<<5; + if (ud.runkey_mode) loc.bits |= (ud.auto_run | BUTTON(gamefunc_Run))<<5; + else loc.bits |= (BUTTON(gamefunc_Run) ^ ud.auto_run)<<5; loc.bits |= BUTTON(gamefunc_Look_Left)<<6; loc.bits |= BUTTON(gamefunc_Look_Right)<<7; - if ( aplWeaponFlags[ps[snum].curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO && BUTTON( gamefunc_Fire ) ) + if (aplWeaponFlags[ps[snum].curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO && BUTTON(gamefunc_Fire)) CONTROL_ClearButton(gamefunc_Fire); if (jump_input > 0) @@ -2879,7 +2879,7 @@ void getinput(short snum) loc.bits |= myaimmode<<23; loc.bits |= BUTTON(gamefunc_Holo_Duke)<<24; loc.bits |= BUTTON(gamefunc_Jetpack)<<25; - loc.bits |= (((long)gamequit)<<26); + loc.bits |= (((long)gamequit)<<26); loc.bits |= BUTTON(gamefunc_Inventory_Right)<<27; loc.bits |= BUTTON(gamefunc_TurnAround)<<28; loc.bits |= BUTTON(gamefunc_Open)<<29; @@ -2897,7 +2897,7 @@ void getinput(short snum) if (SmoothInput) { - if ( BUTTON(gamefunc_Strafe) ) { + if (BUTTON(gamefunc_Strafe)) { svel = -(info.dyaw+lastinfo.dyaw)/8; lastinfo.dyaw = (lastinfo.dyaw+info.dyaw) % 8; } else { @@ -2913,7 +2913,7 @@ void getinput(short snum) } else { - if ( BUTTON(gamefunc_Strafe) ) { + if (BUTTON(gamefunc_Strafe)) { svel = -info.dyaw/8; } else { angvel = info.dyaw/64; @@ -2941,14 +2941,14 @@ void getinput(short snum) if (BUTTON(gamefunc_Strafe)) { - if ( BUTTON(gamefunc_Turn_Left) && !(ps[snum].movement_lock&4)) + if (BUTTON(gamefunc_Turn_Left) && !(ps[snum].movement_lock&4)) svel -= -keymove; - if ( BUTTON(gamefunc_Turn_Right) && !(ps[snum].movement_lock&8)) + if (BUTTON(gamefunc_Turn_Right) && !(ps[snum].movement_lock&8)) svel -= keymove; } else { - if ( BUTTON(gamefunc_Turn_Left)) + if (BUTTON(gamefunc_Turn_Left)) { turnheldtime += tics; if (turnheldtime>=TURBOTURNTIME) @@ -2956,7 +2956,7 @@ void getinput(short snum) else angvel -= PREAMBLETURN; } - else if ( BUTTON(gamefunc_Turn_Right)) + else if (BUTTON(gamefunc_Turn_Right)) { turnheldtime += tics; if (turnheldtime>=TURBOTURNTIME) @@ -2968,13 +2968,13 @@ void getinput(short snum) turnheldtime=0; } - if ( BUTTON(gamefunc_Strafe_Left) && !(ps[snum].movement_lock&4)) + if (BUTTON(gamefunc_Strafe_Left) && !(ps[snum].movement_lock&4)) svel += keymove; - if ( BUTTON(gamefunc_Strafe_Right) && !(ps[snum].movement_lock&8)) + if (BUTTON(gamefunc_Strafe_Right) && !(ps[snum].movement_lock&8)) svel += -keymove; - if ( BUTTON(gamefunc_Move_Forward) && !(ps[snum].movement_lock&1)) + if (BUTTON(gamefunc_Move_Forward) && !(ps[snum].movement_lock&1)) vel += keymove; - if ( BUTTON(gamefunc_Move_Backward) && !(ps[snum].movement_lock&2)) + if (BUTTON(gamefunc_Move_Backward) && !(ps[snum].movement_lock&2)) vel += -keymove; if (vel < -MAXVEL) vel = -MAXVEL; @@ -3005,7 +3005,7 @@ void getinput(short snum) return; } - if ( numplayers > 1 ) + if (numplayers > 1) daang = myang; else daang = p->ang; @@ -3041,18 +3041,18 @@ char doincrements(struct player_struct *p) if (p->tipincs > 0) p->tipincs--; - if (p->last_pissed_time > 0 ) + if (p->last_pissed_time > 0) { p->last_pissed_time--; - if ( p->last_pissed_time == (26*219) ) + if (p->last_pissed_time == (26*219)) { spritesound(FLUSH_TOILET,p->i); if (snum == screenpeek || GTFLAGS(GAMETYPE_FLAG_COOPSOUND)) spritesound(DUKE_PISSRELIEF,p->i); } - if ( p->last_pissed_time == (26*218) ) + if (p->last_pissed_time == (26*218)) { p->holster_weapon = 0; p->weapon_pos = 10; @@ -3069,12 +3069,12 @@ char doincrements(struct player_struct *p) } } - if ( p->steroids_amount > 0 && p->steroids_amount < 400) + if (p->steroids_amount > 0 && p->steroids_amount < 400) { p->steroids_amount--; if (p->steroids_amount == 0) checkavailinven(p); - if ( !(p->steroids_amount&7) ) + if (!(p->steroids_amount&7)) if (snum == screenpeek || GTFLAGS(GAMETYPE_FLAG_COOPSOUND)) spritesound(DUKE_HARTBEAT,p->i); } @@ -3082,7 +3082,7 @@ char doincrements(struct player_struct *p) if (p->heat_on && p->heat_amount > 0) { p->heat_amount--; - if ( p->heat_amount == 0 ) + if (p->heat_amount == 0) { p->heat_on = 0; checkavailinven(p); @@ -3091,7 +3091,7 @@ char doincrements(struct player_struct *p) } } - if ( p->holoduke_on >= 0 ) + if (p->holoduke_on >= 0) { p->holoduke_amount--; if (p->holoduke_amount <= 0) @@ -3102,7 +3102,7 @@ char doincrements(struct player_struct *p) } } - if ( p->jetpack_on && p->jetpack_amount > 0 ) + if (p->jetpack_on && p->jetpack_amount > 0) { p->jetpack_amount--; if (p->jetpack_amount <= 0) @@ -3119,7 +3119,7 @@ char doincrements(struct player_struct *p) { last_quick_kick[snum] = p->quick_kick+1; p->quick_kick--; - if ( p->quick_kick == 8 ) + if (p->quick_kick == 8) shoot(p->i,KNEE); } else if (last_quick_kick[snum] > 0) last_quick_kick[snum]--; @@ -3215,7 +3215,7 @@ char doincrements(struct player_struct *p) spritesound(DUKE_CRACK_FIRST,p->i); } - else if ( p->knuckle_incs == 22 || (sync[snum].bits&(1<<2))) + else if (p->knuckle_incs == 22 || (sync[snum].bits&(1<<2))) p->knuckle_incs=0; return 1; @@ -3304,7 +3304,7 @@ void processinput(short snum) p->truecz = getceilzofslope(psect,p->posx,p->posy); truefdist = klabs(p->posz-j); - if ( (lz&49152) == 16384 && psectlotag == 1 && truefdist > PHEIGHT+(16<<8) ) + if ((lz&49152) == 16384 && psectlotag == 1 && truefdist > PHEIGHT+(16<<8)) psectlotag = 0; hittype[pi].floorz = fz; @@ -3313,7 +3313,7 @@ void processinput(short snum) p->ohoriz = p->horiz; p->ohorizoff = p->horizoff; - if ( p->aim_mode == 0 && p->on_ground && psectlotag != 2 && (sector[psect].floorstat&2) ) + if (p->aim_mode == 0 && p->on_ground && psectlotag != 2 && (sector[psect].floorstat&2)) { x = p->posx+(sintable[(p->ang+512)&2047]>>5); y = p->posy+(sintable[p->ang&2047]>>5); @@ -3332,7 +3332,7 @@ void processinput(short snum) if (p->horizoff > 0) p->horizoff -= ((p->horizoff>>3)+1); else if (p->horizoff < 0) p->horizoff += (((-p->horizoff)>>3)+1); - if ( hz >= 0 && (hz&49152) == 49152) + if (hz >= 0 && (hz&49152) == 49152) { hz &= (MAXSPRITES-1); @@ -3347,14 +3347,14 @@ void processinput(short snum) { j = lz&(MAXSPRITES-1); - if ( (sprite[j].cstat&33) == 33 ) + if ((sprite[j].cstat&33) == 33) { psectlotag = 0; p->footprintcount = 0; p->spritebridge = 1; p->sbs = j; } - else if (badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(s->z-sprite[j].z) < (84<<8) ) + else if (badguy(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(s->z-sprite[j].z) < (84<<8)) { j = getangle(sprite[j].x-p->posx,sprite[j].y-p->posy); p->posxv -= sintable[(j+512)&2047]<<4; @@ -3363,7 +3363,7 @@ void processinput(short snum) } - if ( s->extra > 0 ) incur_damage( p ); + if (s->extra > 0) incur_damage(p); else { s->extra = 0; @@ -3406,7 +3406,7 @@ void processinput(short snum) } else { - if (ud.level_number == ud.secretlevel && ud.from_bonus > 0 ) + if (ud.level_number == ud.secretlevel && ud.from_bonus > 0) ud.level_number = ud.from_bonus; else ud.level_number++; @@ -3490,7 +3490,7 @@ void processinput(short snum) } } - if ( s->extra <= 0 ) + if (s->extra <= 0) { if (p->dead_flag == 0) { @@ -3525,9 +3525,9 @@ void processinput(short snum) p->scream_voice = FX_Ok; } - if ( s->pal != 1 && (s->cstat&32768) == 0) s->cstat = 0; + if (s->pal != 1 && (s->cstat&32768) == 0) s->cstat = 0; - if ( ud.multimode > 1 && ( s->pal != 1 || (s->cstat&32768) ) ) + if (ud.multimode > 1 && (s->pal != 1 || (s->cstat&32768))) { if (p->frag_ps != snum) { @@ -3631,11 +3631,11 @@ void processinput(short snum) } } - if ( psectlotag == 2 ) + if (psectlotag == 2) { if (p->on_warping_sector == 0) { - if ( klabs(p->posz-fz) > (PHEIGHT>>1)) + if (klabs(p->posz-fz) > (PHEIGHT>>1)) p->posz += 348; } else @@ -3663,8 +3663,8 @@ void processinput(short snum) pushmove(&p->posx,&p->posy,&p->posz,&p->cursectnum,128L,(4L<<8),(20L<<8),CLIPMASK0); - if ( fz > cz+(16<<8) && s->pal != 1) - p->rotscrnang = (p->dead_flag + ( (fz+p->posz)>>7))&2047; + if (fz > cz+(16<<8) && s->pal != 1) + p->rotscrnang = (p->dead_flag + ((fz+p->posz)>>7))&2047; p->on_warping_sector = 0; @@ -3706,7 +3706,7 @@ void processinput(short snum) p->look_ang -= (p->look_ang>>2); - if ( sb_snum&(1<<6) ) + if (sb_snum&(1<<6)) { // look_left SetGameVarID(g_iReturnVarID,0,pi,snum); @@ -3718,7 +3718,7 @@ void processinput(short snum) } } - if ( sb_snum&(1<<7) ) + if (sb_snum&(1<<7)) { // look_right SetGameVarID(g_iReturnVarID,0,pi,snum); @@ -3744,21 +3744,21 @@ void processinput(short snum) } */ - if ( s->xvel < 32 || p->on_ground == 0 || p->bobcounter == 1024 ) + if (s->xvel < 32 || p->on_ground == 0 || p->bobcounter == 1024) { - if ( (p->weapon_sway&2047) > (1024+96) ) + if ((p->weapon_sway&2047) > (1024+96)) p->weapon_sway -= 96; - else if ( (p->weapon_sway&2047) < (1024-96) ) + else if ((p->weapon_sway&2047) < (1024-96)) p->weapon_sway += 96; else p->weapon_sway = 1024; } else p->weapon_sway = p->bobcounter; s->xvel = - ksqrt( (p->posx-p->bobposx)*(p->posx-p->bobposx)+(p->posy-p->bobposy)*(p->posy-p->bobposy)); + ksqrt((p->posx-p->bobposx)*(p->posx-p->bobposx)+(p->posy-p->bobposy)*(p->posy-p->bobposy)); if (p->on_ground) p->bobcounter += sprite[p->i].xvel>>1; - if ( ud.clipping == 0 && ( sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS) ) + if (ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS)) { p->posx = p->oposx; p->posy = p->oposy; @@ -3786,7 +3786,7 @@ void processinput(short snum) i = 40; - if ( psectlotag == 2) + if (psectlotag == 2) { // under water p->jumping_counter = 0; @@ -3798,7 +3798,7 @@ void processinput(short snum) if (!isspritemakingsound(pi,DUKE_UNDERWATER)) spritesound(DUKE_UNDERWATER,pi); - if ( sb_snum&1 ) + if (sb_snum&1) { SetGameVarID(g_iReturnVarID,0,pi,snum); OnEvent(EVENT_SWIMUP,pi,snum, -1); @@ -3844,16 +3844,16 @@ void processinput(short snum) p->posz += p->poszv; - if (p->posz > (fz-(15<<8)) ) + if (p->posz > (fz-(15<<8))) p->posz += ((fz-(15<<8))-p->posz)>>1; - if (p->posz < (cz+(4<<8)) ) + if (p->posz < (cz+(4<<8))) { p->posz = cz+(4<<8); p->poszv = 0; } - if ( p->scuba_on && (TRAND&255) < 8 ) + if (p->scuba_on && (TRAND&255) < 8) { j = spawn(pi,WATERBUBBLE); sprite[j].x += @@ -3888,7 +3888,7 @@ void processinput(short snum) if (shrunk) j = 512; else j = 2048; - if ( sb_snum&1 ) //A (soar high) + if (sb_snum&1) //A (soar high) { // jump SetGameVarID(g_iReturnVarID,0,pi,snum); @@ -3912,19 +3912,19 @@ void processinput(short snum) } } - if ( shrunk == 0 && (psectlotag == 0 || psectlotag == 2)) k = 32; + if (shrunk == 0 && (psectlotag == 0 || psectlotag == 2)) k = 32; else k = 16; - if ( psectlotag != 2 && p->scuba_on == 1 ) + if (psectlotag != 2 && p->scuba_on == 1) p->scuba_on = 0; - if (p->posz > (fz-(k<<8)) ) + if (p->posz > (fz-(k<<8))) p->posz += ((fz-(k<<8))-p->posz)>>1; - if (p->posz < (hittype[pi].ceilingz+(18<<8)) ) + if (p->posz < (hittype[pi].ceilingz+(18<<8))) p->posz = hittype[pi].ceilingz+(18<<8); } - else if ( psectlotag != 2 ) + else if (psectlotag != 2) { if (p->airleft != 15*26) p->airleft = 15*26; //Aprox twenty seconds. @@ -3932,7 +3932,7 @@ void processinput(short snum) if (p->scuba_on == 1) p->scuba_on = 0; - if ( psectlotag == 1 && p->spritebridge == 0) + if (psectlotag == 1 && p->spritebridge == 0) { if (shrunk == 0) { @@ -3947,7 +3947,7 @@ void processinput(short snum) { if (p->on_ground == 1) { - if ( p->dummyplayersprite == -1 ) + if (p->dummyplayersprite == -1) p->dummyplayersprite = spawn(pi,PLAYERONWATER); sprite[p->dummyplayersprite].pal = sprite[p->i].pal; @@ -3962,17 +3962,17 @@ void processinput(short snum) else { if (p->footprintcount > 0 && p->on_ground) - if ( (sector[p->cursectnum].floorstat&2) != 2 ) + if ((sector[p->cursectnum].floorstat&2) != 2) { for (j=headspritesect[psect];j>=0;j=nextspritesect[j]) - if ( sprite[j].picnum == FOOTPRINTS || sprite[j].picnum == FOOTPRINTS2 || sprite[j].picnum == FOOTPRINTS3 || sprite[j].picnum == FOOTPRINTS4 ) + if (sprite[j].picnum == FOOTPRINTS || sprite[j].picnum == FOOTPRINTS2 || sprite[j].picnum == FOOTPRINTS3 || sprite[j].picnum == FOOTPRINTS4) if (klabs(sprite[j].x-p->posx) < 384) if (klabs(sprite[j].y-p->posy) < 384) break; if (j < 0) { p->footprintcount--; - if ( sector[p->cursectnum].lotag == 0 && sector[p->cursectnum].hitag == 0 ) + if (sector[p->cursectnum].lotag == 0 && sector[p->cursectnum].hitag == 0) { switch (TRAND&3) { @@ -3992,11 +3992,11 @@ void processinput(short snum) } } - if (p->posz < (fz-(i<<8)) ) //falling + if (p->posz < (fz-(i<<8))) //falling { // not jumping or crouching - if ( (sb_snum&3) == 0 && p->on_ground && (sector[psect].floorstat&2) && p->posz >= (fz-(i<<8)-(16<<8) ) ) + if ((sb_snum&3) == 0 && p->on_ground && (sector[psect].floorstat&2) && p->posz >= (fz-(i<<8)-(16<<8))) p->posz = fz-(i<<8); else { @@ -4006,16 +4006,16 @@ void processinput(short snum) if (p->poszv > 2400 && p->falling_counter < 255) { p->falling_counter++; - if ( p->falling_counter == 38 ) + if (p->falling_counter == 38) p->scream_voice = spritesound(DUKE_SCREAM,pi); } - if ( (p->posz+p->poszv) >= (fz-(i<<8)) ) // hit the ground + if ((p->posz+p->poszv) >= (fz-(i<<8))) // hit the ground if (sector[p->cursectnum].lotag != 1) { - if ( p->falling_counter > 62 ) quickkill(p); + if (p->falling_counter > 62) quickkill(p); - else if ( p->falling_counter > 9 ) + else if (p->falling_counter > 9) { j = p->falling_counter; s->extra -= j-(TRAND&3); @@ -4057,12 +4057,12 @@ void processinput(short snum) p->on_ground = 1; - if ( i==40 ) + if (i==40) { //Smooth on the ground k = ((fz-(i<<8))-p->posz)>>1; - if ( klabs(k) < 256 ) k = 0; + if (klabs(k) < 256) k = 0; p->posz += k; p->poszv -= 768; if (p->poszv < 0) p->poszv = 0; @@ -4079,7 +4079,7 @@ void processinput(short snum) p->on_warping_sector = 0; - if ( (sb_snum&2) ) + if ((sb_snum&2)) { // crouching SetGameVarID(g_iReturnVarID,0,pi,snum); @@ -4092,13 +4092,13 @@ void processinput(short snum) } // jumping - if ( (sb_snum&1) == 0 && p->jumping_toggle == 1) + if ((sb_snum&1) == 0 && p->jumping_toggle == 1) p->jumping_toggle = 0; - else if ( (sb_snum&1) && p->jumping_toggle == 0 ) + else if ((sb_snum&1) && p->jumping_toggle == 0) { - if ( p->jumping_counter == 0 ) - if ( (fz-cz) > (56<<8) ) + if (p->jumping_counter == 0) + if ((fz-cz) > (56<<8)) { SetGameVarID(g_iReturnVarID,0,pi,snum); OnEvent(EVENT_JUMP,pi,snum, -1); @@ -4110,16 +4110,16 @@ void processinput(short snum) } } - if ( p->jumping_counter && (sb_snum&1) == 0 ) + if (p->jumping_counter && (sb_snum&1) == 0) p->jumping_toggle = 0; } if (p->jumping_counter) { - if ( (sb_snum&1) == 0 && p->jumping_toggle == 1) + if ((sb_snum&1) == 0 && p->jumping_toggle == 1) p->jumping_toggle = 0; - if ( p->jumping_counter < (1024+256) ) + if (p->jumping_counter < (1024+256)) { if (psectlotag == 1 && p->jumping_counter > 768) { @@ -4154,26 +4154,26 @@ void processinput(short snum) //Do the quick lefts and rights - if ( p->fist_incs || + if (p->fist_incs || p->transporter_hold > 2 || p->hard_landing || p->access_incs > 0 || p->knee_incs > 0 || (*aplWeaponWorksLike[p->curr_weapon] == TRIPBOMB_WEAPON && *kb > 1 && - *kb < 4 ) ) + *kb < 4)) { doubvel = 0; p->posxv = 0; p->posyv = 0; } - else if ( sync[snum].avel ) //p->ang += syncangvel * constant + else if (sync[snum].avel) //p->ang += syncangvel * constant { //ENGINE calculates angvel for you long tempang; tempang = sync[snum].avel<<1; - if ( psectlotag == 2 ) p->angvel =(tempang-(tempang>>3))*ksgn(doubvel); + if (psectlotag == 2) p->angvel =(tempang-(tempang>>3))*ksgn(doubvel); else p->angvel = tempang*ksgn(doubvel); p->ang += p->angvel; @@ -4185,7 +4185,7 @@ void processinput(short snum) { j = sector[s->sectnum].floorpicnum; - if ( j == PURPLELAVA || sector[s->sectnum].ceilingpicnum == PURPLELAVA ) + if (j == PURPLELAVA || sector[s->sectnum].ceilingpicnum == PURPLELAVA) { if (p->boot_amount > 0) { @@ -4211,7 +4211,7 @@ void processinput(short snum) switch (dynamictostatic[j]) { case HURTRAIL__STATIC: - if ( rnd(32) ) + if (rnd(32)) { if (p->boot_amount > 0) k = 1; @@ -4228,7 +4228,7 @@ void processinput(short snum) } break; case FLOORSLIME__STATIC: - if ( rnd(16) ) + if (rnd(16)) { if (p->boot_amount > 0) k = 1; @@ -4243,9 +4243,9 @@ void processinput(short snum) } break; case FLOORPLASMA__STATIC: - if ( rnd(32) ) + if (rnd(32)) { - if ( p->boot_amount > 0 ) + if (p->boot_amount > 0) k = 1; else { @@ -4260,7 +4260,7 @@ void processinput(short snum) } } - if ( k ) + if (k) { FTA(75,p); p->boot_amount -= 2; @@ -4269,21 +4269,21 @@ void processinput(short snum) } } - if ( p->posxv || p->posyv || sync[snum].fvel || sync[snum].svel ) + if (p->posxv || p->posyv || sync[snum].fvel || sync[snum].svel) { p->crack_time = 777; k = sintable[p->bobcounter&2047]>>12; - if ((truefdist < PHEIGHT+(8<<8) ) && ( k == 1 || k == 3 )) + if ((truefdist < PHEIGHT+(8<<8)) && (k == 1 || k == 3)) { if (p->spritebridge == 0 && p->walking_snd_toggle == 0 && p->on_ground) { - switch ( psectlotag ) + switch (psectlotag) { case 0: - if (lz >= 0 && (lz&(MAXSPRITES-1))==49152 ) + if (lz >= 0 && (lz&(MAXSPRITES-1))==49152) j = sprite[lz&(MAXSPRITES-1)].picnum; else j = sector[psect].floorpicnum; @@ -4339,7 +4339,7 @@ void processinput(short snum) p->posxv += ((sync[snum].fvel*doubvel)<<6); p->posyv += ((sync[snum].svel*doubvel)<<6); - if ( ( aplWeaponWorksLike[p->curr_weapon] == KNEE_WEAPON && *kb > 10 && p->on_ground ) || ( p->on_ground && (sb_snum&2) ) ) + if ((aplWeaponWorksLike[p->curr_weapon] == KNEE_WEAPON && *kb > 10 && p->on_ground) || (p->on_ground && (sb_snum&2))) { p->posxv = mulscale(p->posxv,p->runspeed-0x2000,16); p->posyv = mulscale(p->posyv,p->runspeed-0x2000,16); @@ -4358,10 +4358,10 @@ void processinput(short snum) } } - if ( abs(p->posxv) < 2048 && abs(p->posyv) < 2048 ) + if (abs(p->posxv) < 2048 && abs(p->posyv) < 2048) p->posxv = p->posyv = 0; - if ( shrunk ) + if (shrunk) { p->posxv = mulscale16(p->posxv,p->runspeed-(p->runspeed>>1)+(p->runspeed>>2)); @@ -4399,9 +4399,9 @@ HORIZONLY: if (p->jetpack_on == 0) { - if ( s->xvel > 16 ) + if (s->xvel > 16) { - if ( psectlotag != 1 && psectlotag != 2 && p->on_ground ) + if (psectlotag != 1 && psectlotag != 2 && p->on_ground) { p->pycount += 52; p->pycount &= 2047; @@ -4409,19 +4409,19 @@ HORIZONLY: klabs(s->xvel*sintable[p->pycount])/1596; } } - else if ( psectlotag != 2 && psectlotag != 1 ) + else if (psectlotag != 2 && psectlotag != 1) p->pyoff = 0; } // RBG*** setsprite(pi,p->posx,p->posy,p->posz+PHEIGHT); - if ( psectlotag < 3 ) + if (psectlotag < 3) { psect = s->sectnum; - if ( ud.clipping == 0 && sector[psect].lotag == 31) + if (ud.clipping == 0 && sector[psect].lotag == 31) { - if ( sprite[sector[psect].hitag].xvel && hittype[sector[psect].hitag].temp_data[0] == 0) + if (sprite[sector[psect].hitag].xvel && hittype[sector[psect].hitag].temp_data[0] == 0) { quickkill(p); return; @@ -4437,15 +4437,15 @@ HORIZONLY: changespritesect(pi,p->cursectnum); if (ud.clipping == 0) - j = ( pushmove(&p->posx,&p->posy,&p->posz,&p->cursectnum,164L,(4L<<8),(4L<<8),CLIPMASK0) < 0 && furthestangle(pi,8) < 512 ); + j = (pushmove(&p->posx,&p->posy,&p->posz,&p->cursectnum,164L,(4L<<8),(4L<<8),CLIPMASK0) < 0 && furthestangle(pi,8) < 512); else j = 0; if (ud.clipping == 0) { - if ( klabs(hittype[pi].floorz-hittype[pi].ceilingz) < (48<<8) || j ) + if (klabs(hittype[pi].floorz-hittype[pi].ceilingz) < (48<<8) || j) { - if ( !(sector[s->sectnum].lotag&0x8000) && ( isanunderoperator(sector[s->sectnum].lotag) || - isanearoperator(sector[s->sectnum].lotag) ) ) + if (!(sector[s->sectnum].lotag&0x8000) && (isanunderoperator(sector[s->sectnum].lotag) || + isanearoperator(sector[s->sectnum].lotag))) activatebysector(s->sectnum,pi); if (j) { @@ -4453,13 +4453,13 @@ HORIZONLY: return; } } - else if ( klabs(fz-cz) < (32<<8) && isanunderoperator(sector[psect].lotag) ) + else if (klabs(fz-cz) < (32<<8) && isanunderoperator(sector[psect].lotag)) activatebysector(psect,pi); } // center_view i = 0; - if ( sb_snum&(1<<18) || p->hard_landing) + if (sb_snum&(1<<18) || p->hard_landing) { SetGameVarID(g_iReturnVarID,0,pi,snum); OnEvent(EVENT_RETURNTOCENTER,pi,snum, -1); @@ -4469,7 +4469,7 @@ HORIZONLY: } } - if ( sb_snum&(1<<13) ) + if (sb_snum&(1<<13)) { // look_up SetGameVarID(g_iReturnVarID,0,pi,snum); @@ -4477,13 +4477,13 @@ HORIZONLY: if (GetGameVarID(g_iReturnVarID,pi,snum) == 0) { p->return_to_center = 9; - if ( sb_snum&(1<<5) ) p->horiz += 12; // running + if (sb_snum&(1<<5)) p->horiz += 12; // running p->horiz += 12; i++; } } - else if ( sb_snum&(1<<14) ) + else if (sb_snum&(1<<14)) { // look_down SetGameVarID(g_iReturnVarID,0,pi,snum); @@ -4491,39 +4491,39 @@ HORIZONLY: if (GetGameVarID(g_iReturnVarID,pi,snum) == 0) { p->return_to_center = 9; - if ( sb_snum&(1<<5) ) p->horiz -= 12; + if (sb_snum&(1<<5)) p->horiz -= 12; p->horiz -= 12; i++; } } - else if ( sb_snum&(1<<3) ) + else if (sb_snum&(1<<3)) { // aim_up SetGameVarID(g_iReturnVarID,0,pi,snum); OnEvent(EVENT_AIMUP,pi,snum, -1); if (GetGameVarID(g_iReturnVarID,pi,snum) == 0) { // running - if ( sb_snum&(1<<5) ) p->horiz += 6; + if (sb_snum&(1<<5)) p->horiz += 6; p->horiz += 6; i++; } } - else if ( sb_snum&(1<<4) ) + else if (sb_snum&(1<<4)) { // aim_down SetGameVarID(g_iReturnVarID,0,pi,snum); OnEvent(EVENT_AIMDOWN,pi,snum, -1); if (GetGameVarID(g_iReturnVarID,pi,snum) == 0) { // running - if ( sb_snum&(1<<5) ) p->horiz -= 6; + if (sb_snum&(1<<5)) p->horiz -= 6; p->horiz -= 6; i++; } } if (p->return_to_center > 0) - if ( (sb_snum&(1<<13)) == 0 && (sb_snum&(1<<14)) == 0 ) + if ((sb_snum&(1<<13)) == 0 && (sb_snum&(1<<14)) == 0) { p->return_to_center--; p->horiz += 33-(p->horiz/3); @@ -4538,8 +4538,8 @@ HORIZONLY: if (i) { - if ( p->horiz > 95 && p->horiz < 105) p->horiz = 100; - if ( p->horizoff > -5 && p->horizoff < 5) p->horizoff = 0; + if (p->horiz > 95 && p->horiz < 105) p->horiz = 100; + if (p->horizoff > -5 && p->horizoff < 5) p->horizoff = 0; } p->horiz += sync[snum].horz; @@ -4557,7 +4557,7 @@ HORIZONLY: p->subweapon |= (1<last_full_weapon == SHRINKER_WEAPON) p->subweapon &= ~(1<last_full_weapon ); + addweapon(p, p->last_full_weapon); return; } } @@ -4616,7 +4616,7 @@ HORIZONLY: p->ang += getincangle(p->ang,getangle(sprite[p->actorsqu].x-p->posx,sprite[p->actorsqu].y-p->posy))>>2; } - if ( doincrements(p) ) return; + if (doincrements(p)) return; if (p->weapon_pos != 0) { @@ -4637,7 +4637,7 @@ HORIZONLY: // HACKS SHOOTINCODE: - if ( sb_snum & (1<<19) ) // 'Holster Weapon + if (sb_snum & (1<<19)) // 'Holster Weapon { SetGameVarID(g_iReturnVarID,0,pi,snum); SetGameVarID(g_iWeaponVarID,p->curr_weapon,pi,snum); @@ -4645,10 +4645,10 @@ SHOOTINCODE: OnEvent(EVENT_HOLSTER, pi, snum, -1); if (GetGameVarID(g_iReturnVarID,pi,snum) == 0) { - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_HOLSTER_CLEARS_CLIP) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_HOLSTER_CLEARS_CLIP) { - if ( p->ammo_amount[p->curr_weapon] > aplWeaponClip[p->curr_weapon][snum] - && (p->ammo_amount[p->curr_weapon] % aplWeaponClip[p->curr_weapon][snum]) != 0 ) + if (p->ammo_amount[p->curr_weapon] > aplWeaponClip[p->curr_weapon][snum] + && (p->ammo_amount[p->curr_weapon] % aplWeaponClip[p->curr_weapon][snum]) != 0) { p->ammo_amount[p->curr_weapon]-= p->ammo_amount[p->curr_weapon] % aplWeaponClip[p->curr_weapon][snum] ; @@ -4660,24 +4660,24 @@ SHOOTINCODE: } } - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_GLOWS) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_GLOWS) p->random_club_frame += 64; // Glowing if (p->rapid_fire_hold == 1) { - if ( sb_snum&(1<<2) ) return; + if (sb_snum&(1<<2)) return; p->rapid_fire_hold = 0; } if (shrunk || p->tipincs || p->access_incs) sb_snum &= ~(1<<2); - else if ( shrunk == 0 && (sb_snum&(1<<2)) && (*kb) == 0 && p->fist_incs == 0 && - p->last_weapon == -1 && ( p->weapon_pos == 0 || p->holster_weapon == 1 ) ) + else if (shrunk == 0 && (sb_snum&(1<<2)) && (*kb) == 0 && p->fist_incs == 0 && + p->last_weapon == -1 && (p->weapon_pos == 0 || p->holster_weapon == 1)) { p->crack_time = 777; if (p->holster_weapon == 1) { - if ( p->last_pissed_time <= (26*218) && p->weapon_pos == -9) + if (p->last_pissed_time <= (26*218) && p->weapon_pos == -9) { p->holster_weapon = 0; p->weapon_pos = 10; @@ -4698,7 +4698,7 @@ SHOOTINCODE: OnEvent(EVENT_FIREWEAPON, p->i, snum, -1); p->hbomb_hold_delay = 0; - if ( p->ammo_amount[p->curr_weapon] > 0 ) + if (p->ammo_amount[p->curr_weapon] > 0) { (*kb)=1; if (aplWeaponInitialSound[p->curr_weapon][snum]) @@ -4720,7 +4720,7 @@ SHOOTINCODE: case SHOTGUN_WEAPON: OnEvent(EVENT_FIREWEAPON, p->i, snum, -1); - if ( p->ammo_amount[p->curr_weapon] > 0 && p->random_club_frame == 0 ) + if (p->ammo_amount[p->curr_weapon] > 0 && p->random_club_frame == 0) { (*kb)=1; if (aplWeaponInitialSound[p->curr_weapon][snum]) @@ -4731,20 +4731,20 @@ SHOOTINCODE: break; case TRIPBOMB_WEAPON: - if ( p->ammo_amount[p->curr_weapon] > 0 ) + if (p->ammo_amount[p->curr_weapon] > 0) { long sx,sy,sz; short sect,hw,hitsp; - hitscan( p->posx, p->posy, p->posz, - p->cursectnum, sintable[(p->ang+512)&2047], - sintable[p->ang&2047], (100-p->horiz-p->horizoff)*32, - §, &hw, &hitsp, &sx, &sy, &sz,CLIPMASK1); + hitscan(p->posx, p->posy, p->posz, + p->cursectnum, sintable[(p->ang+512)&2047], + sintable[p->ang&2047], (100-p->horiz-p->horizoff)*32, + §, &hw, &hitsp, &sx, &sy, &sz,CLIPMASK1); if (sect < 0 || hitsp >= 0) break; - if ( hw >= 0 && sector[sect].lotag > 2 ) + if (hw >= 0 && sector[sect].lotag > 2) break; if (hw >= 0 && wall[hw].overpicnum >= 0) @@ -4754,15 +4754,15 @@ SHOOTINCODE: j = headspritesect[sect]; while (j >= 0) { - if ( sprite[j].picnum == TRIPBOMB && - klabs(sprite[j].z-sz) < (12<<8) && ((sprite[j].x-sx)*(sprite[j].x-sx)+(sprite[j].y-sy)*(sprite[j].y-sy)) < (290*290) ) + if (sprite[j].picnum == TRIPBOMB && + klabs(sprite[j].z-sz) < (12<<8) && ((sprite[j].x-sx)*(sprite[j].x-sx)+(sprite[j].y-sy)*(sprite[j].y-sy)) < (290*290)) break; j = nextspritesect[j]; } - if (j == -1 && hw >= 0 && (wall[hw].cstat&16) == 0 ) - if ( ( wall[hw].nextsector >= 0 && sector[wall[hw].nextsector].lotag <= 2 ) || ( wall[hw].nextsector == -1 && sector[sect].lotag <= 2 ) ) - if ( ( (sx-p->posx)*(sx-p->posx) + (sy-p->posy)*(sy-p->posy) ) < (290*290) ) + if (j == -1 && hw >= 0 && (wall[hw].cstat&16) == 0) + if ((wall[hw].nextsector >= 0 && sector[wall[hw].nextsector].lotag <= 2) || (wall[hw].nextsector == -1 && sector[sect].lotag <= 2)) + if (((sx-p->posx)*(sx-p->posx) + (sy-p->posy)*(sy-p->posy)) < (290*290)) { p->posz = p->oposz; p->poszv = 0; @@ -4782,7 +4782,7 @@ SHOOTINCODE: case FREEZE_WEAPON: case RPG_WEAPON: OnEvent(EVENT_FIREWEAPON, p->i, snum, -1); - if ( p->ammo_amount[p->curr_weapon] > 0) + if (p->ammo_amount[p->curr_weapon] > 0) { (*kb) = 1; if (aplWeaponInitialSound[p->curr_weapon][snum]) @@ -4794,7 +4794,7 @@ SHOOTINCODE: case DEVISTATOR_WEAPON: OnEvent(EVENT_FIREWEAPON, p->i, snum, -1); - if ( p->ammo_amount[p->curr_weapon] > 0 ) + if (p->ammo_amount[p->curr_weapon] > 0) { (*kb) = 1; p->hbomb_hold_delay = !p->hbomb_hold_delay; @@ -4824,7 +4824,7 @@ SHOOTINCODE: { if (aplWeaponWorksLike[p->curr_weapon][snum] == HANDBOMB_WEAPON) { - if ( aplWeaponHoldDelay[p->curr_weapon][snum] && ((*kb) == aplWeaponFireDelay[p->curr_weapon][snum]) && (sb_snum&(1<<2))) + if (aplWeaponHoldDelay[p->curr_weapon][snum] && ((*kb) == aplWeaponFireDelay[p->curr_weapon][snum]) && (sb_snum&(1<<2))) { p->rapid_fire_hold = 1; return; @@ -4836,7 +4836,7 @@ SHOOTINCODE: p->ammo_amount[p->curr_weapon]--; - if (p->on_ground && (sb_snum&2) ) + if (p->on_ground && (sb_snum&2)) { k = 15; i = ((p->horiz+p->horizoff-100)*20); @@ -4874,7 +4874,7 @@ SHOOTINCODE: } k = hits(pi); - if ( k < 512 ) + if (k < 512) { sprite[j].ang += 1024; sprite[j].zvel /= 3; @@ -4882,11 +4882,11 @@ SHOOTINCODE: } p->hbomb_on = 1; } - else if ( (*kb) < aplWeaponHoldDelay[p->curr_weapon][snum] && (sb_snum&(1<<2)) ) + else if ((*kb) < aplWeaponHoldDelay[p->curr_weapon][snum] && (sb_snum&(1<<2))) { p->hbomb_hold_delay++; } - else if ( (*kb) > aplWeaponTotalTime[p->curr_weapon][snum] ) + else if ((*kb) > aplWeaponTotalTime[p->curr_weapon][snum]) { long lPipeBombControl=GetGameVar("PIPEBOMB_CONTROL", PIPEBOMB_REMOTE, -1, snum); @@ -4908,13 +4908,13 @@ SHOOTINCODE: if ((*kb) == aplWeaponFireDelay[p->curr_weapon][snum]) { - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_BOMB_TRIGGER) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_BOMB_TRIGGER) { p->hbomb_on = 0; } if (aplWeaponShoots[p->curr_weapon][snum] != 0) { - if (! (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE )) + if (!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE)) { lastvisinc = totalclock+32; p->visibility = 0; @@ -4957,8 +4957,8 @@ SHOOTINCODE: else if (aplWeaponWorksLike[p->curr_weapon][snum]!=KNEE_WEAPON && *kb >= aplWeaponFireDelay[p->curr_weapon][snum]) checkavailweapon(p); - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_STANDSTILL - && *kb < (aplWeaponFireDelay[p->curr_weapon][snum]+1) ) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_STANDSTILL + && *kb < (aplWeaponFireDelay[p->curr_weapon][snum]+1)) { p->posz = p->oposz; p->poszv = 0; @@ -4983,20 +4983,20 @@ SHOOTINCODE: p->reloading = 1; - if ( (*kb) != (aplWeaponTotalTime[p->curr_weapon][snum])) + if ((*kb) != (aplWeaponTotalTime[p->curr_weapon][snum])) { - if ( (*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1)) + if ((*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1)) { if (aplWeaponReloadSound1[p->curr_weapon][snum]) spritesound(aplWeaponReloadSound1[p->curr_weapon][snum],pi); } - else if ( ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) || - ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) && (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) ) + else if (((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) && !(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING)) || + ((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) && (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RELOAD_TIMING))) { if (aplWeaponReloadSound2[p->curr_weapon][snum]) spritesound(aplWeaponReloadSound2[p->curr_weapon][snum],pi); } - else if ( (*kb) >= (aplWeaponReload[p->curr_weapon][snum]) ) + else if ((*kb) >= (aplWeaponReload[p->curr_weapon][snum])) { *kb=0; p->reloading = 0; @@ -5008,7 +5008,7 @@ SHOOTINCODE: if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AUTOMATIC && (aplWeaponWorksLike[p->curr_weapon][snum]==KNEE_WEAPON?1:p->ammo_amount[p->curr_weapon] > 0)) { - if ( sb_snum&(1<<2) ) + if (sb_snum&(1<<2)) { if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RANDOMRESTART) *kb = 1+(TRAND&3); @@ -5018,32 +5018,32 @@ SHOOTINCODE: } else *kb = 0; - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET && ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { - if ( sb_snum&(1<<2) ) *kb = 1; + if (sb_snum&(1<<2)) *kb = 1; else *kb = 0; } } } - else if ( *kb >= aplWeaponFireDelay[p->curr_weapon][snum] && (*kb) < aplWeaponTotalTime[p->curr_weapon][snum] - && ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) + else if (*kb >= aplWeaponFireDelay[p->curr_weapon][snum] && (*kb) < aplWeaponTotalTime[p->curr_weapon][snum] + && ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AUTOMATIC ) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AUTOMATIC) { if (!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO)) { - if (( sb_snum&(1<<2) ) == 0 && aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET) + if ((sb_snum&(1<<2)) == 0 && aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_RESET) *kb = 0; - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYTHIRD) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYTHIRD) { - if ( ((*(kb))%3) == 0 ) + if (((*(kb))%3) == 0) { DoFire(p); DoSpawn(p); } } - else if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) + else if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) { DoFire(p); DoSpawn(p); @@ -5060,13 +5060,13 @@ SHOOTINCODE: (*kb) > aplWeaponTotalTime[p->curr_weapon][snum]-aplWeaponHoldDelay[p->curr_weapon][snum] && ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { - if ( sb_snum&(1<<2) ) *kb = 1; + if (sb_snum&(1<<2)) *kb = 1; else *kb = 0; } } else { - if ( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) { DoFire(p); DoSpawn(p); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index b688f0369..b7bccfb4a 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -200,7 +200,7 @@ void cachegoodsprites(void) tloadtile(j,1); } tloadtile(BOTTOMSTATUSBAR,1); - if ( ud.multimode > 1) + if (ud.multimode > 1) tloadtile(FRAGBAR,1); tloadtile(VIEWSCREEN,1); @@ -211,21 +211,21 @@ void cachegoodsprites(void) for (i=FOOTPRINTS;i 0 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_FRAGBAR) && ud.multimode > 1) + if (ud.screen_size > 0 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_FRAGBAR) && ud.multimode > 1) { j = 0; for (i=connecthead;i>=0;i=connectpoint2[i]) @@ -423,7 +423,7 @@ void pickrandomspot(short snum) p = &ps[snum]; - if ( ud.multimode > 1 && !(gametype_flags[ud.coop] & GAMETYPE_FLAG_FIXEDRESPAWN)) + if (ud.multimode > 1 && !(gametype_flags[ud.coop] & GAMETYPE_FLAG_FIXEDRESPAWN)) { if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDMSPAWN) { @@ -513,7 +513,7 @@ void resetplayerstats(short snum) p->sbs = 0; p->palette = (char *) &palette[0]; - if (p->steroids_amount < 400 ) + if (p->steroids_amount < 400) { p->steroids_amount = 0; p->inven_icon = 0; @@ -540,8 +540,8 @@ void resetplayerstats(short snum) p->on_crane = -1; - if ( (aplWeaponWorksLike[p->curr_weapon][snum] == PISTOL_WEAPON) && - (aplWeaponReload[p->curr_weapon][snum] > aplWeaponTotalTime[p->curr_weapon][snum]) ) + if ((aplWeaponWorksLike[p->curr_weapon][snum] == PISTOL_WEAPON) && + (aplWeaponReload[p->curr_weapon][snum] > aplWeaponTotalTime[p->curr_weapon][snum])) p->kickback_pic = aplWeaponTotalTime[p->curr_weapon][snum]+1; else p->kickback_pic = 0; @@ -568,9 +568,9 @@ void resetweapons(short snum) p = &ps[snum]; - for ( weapon = PISTOL_WEAPON; weapon < MAX_WEAPONS; weapon++ ) + for (weapon = PISTOL_WEAPON; weapon < MAX_WEAPONS; weapon++) p->gotweapon[weapon] = 0; - for ( weapon = PISTOL_WEAPON; weapon < MAX_WEAPONS; weapon++ ) + for (weapon = PISTOL_WEAPON; weapon < MAX_WEAPONS; weapon++) p->ammo_amount[weapon] = 0; p->weapon_pos = 6; @@ -655,7 +655,7 @@ void resetprestat(short snum,char g) numinterpolations = 0; startofdynamicinterpolations = 0; - if ( ( (g&MODE_EOL) != MODE_EOL && numplayers < 2) || (!(gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && numplayers > 1) ) + if (((g&MODE_EOL) != MODE_EOL && numplayers < 2) || (!(gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && numplayers > 1)) { resetweapons(snum); resetinventory(snum); @@ -723,7 +723,7 @@ void prelevel(char g) { case 20: case 22: - if ( sector[i].floorz > sector[i].ceilingz) + if (sector[i].floorz > sector[i].ceilingz) sector[i].lotag |= 32768; continue; } @@ -765,7 +765,7 @@ void prelevel(char g) nexti = nextspritestat[i]; ResetActorGameVars(i); LoadActor(i, -1, -1); - if (sprite[i].lotag == -1 && (sprite[i].cstat&16) ) + if (sprite[i].lotag == -1 && (sprite[i].cstat&16)) { ps[0].exitx = SX; ps[0].exity = SY; @@ -820,7 +820,7 @@ void prelevel(char g) for (i=0;i < MAXSPRITES;i++) if (sprite[i].statnum < MAXSTATUS) { - if ( PN == SECTOREFFECTOR && SLT == 14 ) + if (PN == SECTOREFFECTOR && SLT == 14) spawn(-1,i); } @@ -845,10 +845,10 @@ void prelevel(char g) case LOCKSWITCH1__STATIC: case POWERSWITCH2__STATIC: for (j=0;j 63) gameexit("\nToo many mirrors (64 max.)"); - if ( (j >= 0) && sector[j].ceilingpicnum != MIRROR ) + if ((j >= 0) && sector[j].ceilingpicnum != MIRROR) { sector[j].ceilingpicnum = MIRROR; sector[j].floorpicnum = MIRROR; @@ -1034,10 +1034,10 @@ void newgame(char vn,char ln,char sk) waitforeverybody(); ready2send = 0; - if ( ud.m_recstat != 2 && ud.last_level >= 0 && ud.multimode > 1 && (ud.coop&GAMETYPE_FLAG_SCORESHEET)) + if (ud.m_recstat != 2 && ud.last_level >= 0 && ud.multimode > 1 && (ud.coop&GAMETYPE_FLAG_SCORESHEET)) dobonus(1); - if ( ln == 0 && vn == 3 && ud.multimode < 2 && ud.lockout == 0) + if (ln == 0 && vn == 3 && ud.multimode < 2 && ud.lockout == 0) { playmusic(&env_music_fn[1][0]); @@ -1100,7 +1100,7 @@ void newgame(char vn,char ln,char sk) } display_mirror = 0; - if (ud.multimode > 1 ) + if (ud.multimode > 1) { if (numplayers < 2) { @@ -1196,7 +1196,7 @@ void resetpspritevars(char g) nexti = nextspritestat[i]; s = &sprite[i]; - if ( numplayersprites == MAXPLAYERS) + if (numplayersprites == MAXPLAYERS) gameexit("\nToo many player sprites (max 16.)"); if (numplayersprites == 0) @@ -1222,7 +1222,7 @@ void resetpspritevars(char g) s->xoffset = 0; s->clipdist = 64; - if ( (g&MODE_EOL) != MODE_EOL || ps[j].last_extra == 0) + if ((g&MODE_EOL) != MODE_EOL || ps[j].last_extra == 0) { ps[j].last_extra = max_player_health; s->extra = max_player_health; @@ -1241,13 +1241,13 @@ void resetpspritevars(char g) for (k=0;k= 17 ) + if (which_palookup >= 17) which_palookup = 9; k=0; } } ud.pcolor[j] = s->pal = ps[j].palookup = which_palookup++; - if ( which_palookup >= 17 ) + if (which_palookup >= 17) which_palookup = 9; } else ud.pcolor[j] = ps[j].palookup = s->pal; @@ -1410,7 +1410,7 @@ void dofrontscreens(char *statustext) nextpage(); return; } - if ( boardfilename[0] != 0 && ud.level_number == 7 && ud.volume_number == 0 ) + if (boardfilename[0] != 0 && ud.level_number == 7 && ud.volume_number == 0) { menutext(160,90,0,0,"ENTERING USER MAP"); gametextpal(160,90+10,boardfilename,14,2); @@ -1508,7 +1508,7 @@ int enterlevel(char g) long l; char levname[BMAX_PATH]; - if ( (g&MODE_DEMO) != MODE_DEMO ) ud.recstat = ud.m_recstat; + if ((g&MODE_DEMO) != MODE_DEMO) ud.recstat = ud.m_recstat; ud.respawn_monsters = ud.m_respawn_monsters; ud.respawn_items = ud.m_respawn_items; ud.respawn_inventory = ud.m_respawn_inventory; @@ -1522,13 +1522,13 @@ int enterlevel(char g) Bmemset(votes,0,sizeof(votes)); Bmemset(gotvote,0,sizeof(gotvote)); - if ( (g&MODE_DEMO) == 0 && ud.recstat == 2) + if ((g&MODE_DEMO) == 0 && ud.recstat == 2) ud.recstat = 0; if (VOLUMEALL) Bsprintf(tempbuf,HEAD2); else Bsprintf(tempbuf,HEAD); - if ( boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0 ) + if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0) { Bstrcpy(levname, boardfilename); Bsprintf(apptitle," - %s",levname); @@ -1550,9 +1550,9 @@ int enterlevel(char g) if (!VOLUMEONE) { - if ( boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0 ) + if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0) { - if ( loadboard( boardfilename,0,&ps[0].posx, &ps[0].posy, &ps[0].posz, &ps[0].ang,&ps[0].cursectnum ) == -1 ) + if (loadboard(boardfilename,0,&ps[0].posx, &ps[0].posy, &ps[0].posz, &ps[0].ang,&ps[0].cursectnum) == -1) { initprintf("Map %s not found!\n",boardfilename); //gameexit(tempbuf); @@ -1566,14 +1566,14 @@ int enterlevel(char g) if (!loadmaphack(levname)) initprintf("Loaded map hack file %s\n",levname); } } - else if ( loadboard( level_file_names[ (ud.volume_number*11)+ud.level_number],0,&ps[0].posx, &ps[0].posy, &ps[0].posz, &ps[0].ang,&ps[0].cursectnum ) == -1) + else if (loadboard(level_file_names[(ud.volume_number*11)+ud.level_number],0,&ps[0].posx, &ps[0].posy, &ps[0].posz, &ps[0].ang,&ps[0].cursectnum) == -1) { initprintf("Map %s not found!\n",level_file_names[(ud.volume_number*11)+ud.level_number]); //gameexit(tempbuf); return 1; } else { char *p; - strcpy(levname, level_file_names[ (ud.volume_number*11)+ud.level_number]); + strcpy(levname, level_file_names[(ud.volume_number*11)+ud.level_number]); p = Bstrrchr(levname,'.'); if (!p) strcat(levname,".mhk"); else { p[1]='m'; p[2]='h'; p[3]='k'; p[4]=0; } @@ -1582,12 +1582,12 @@ int enterlevel(char g) } else { - l = strlen(level_file_names[ (ud.volume_number*11)+ud.level_number]); - copybufbyte( level_file_names[ (ud.volume_number*11)+ud.level_number],&levname[0],l); + l = strlen(level_file_names[(ud.volume_number*11)+ud.level_number]); + copybufbyte(level_file_names[(ud.volume_number*11)+ud.level_number],&levname[0],l); levname[l] = 255; levname[l+1] = 0; - if ( loadboard( levname,1,&ps[0].posx, &ps[0].posy, &ps[0].posz, &ps[0].ang,&ps[0].cursectnum ) == -1) + if (loadboard(levname,1,&ps[0].posx, &ps[0].posy, &ps[0].posz, &ps[0].ang,&ps[0].cursectnum) == -1) { initprintf("Map %s not found!\n",level_file_names[(ud.volume_number*11)+ud.level_number]); //gameexit(tempbuf); @@ -1624,7 +1624,7 @@ int enterlevel(char g) playmusic(&music_fn[0][music_select][0]); } - if ( (g&MODE_GAME) || (g&MODE_EOL) ) + if ((g&MODE_GAME) || (g&MODE_EOL)) ps[myconnectindex].gm = MODE_GAME; else if (g&MODE_RESTART) { @@ -1633,7 +1633,7 @@ int enterlevel(char g) else ps[myconnectindex].gm = MODE_GAME; } - if ( (ud.recstat == 1) && (g&MODE_RESTART) != MODE_RESTART ) + if ((ud.recstat == 1) && (g&MODE_RESTART) != MODE_RESTART) opendemowrite(); if (VOLUMEONE) { diff --git a/polymer/eduke32/source/rts.c b/polymer/eduke32/source/rts.c index 2386d3461..53158b616 100644 --- a/polymer/eduke32/source/rts.c +++ b/polymer/eduke32/source/rts.c @@ -58,7 +58,7 @@ char lumplockbyte[11]; ==================== */ -int32 RTS_AddFile (char *filename) +int32 RTS_AddFile(char *filename) { wadinfo_t header; lumpinfo_t *lump_p; @@ -81,7 +81,7 @@ int32 RTS_AddFile (char *filename) // WAD file initprintf(" Adding %s.\n",filename); - kread( handle, &header, sizeof( header ) ); + kread(handle, &header, sizeof(header)); if (strncmp(header.identification,"IWAD",4)) { initprintf("RTS file %s doesn't have IWAD id\n",filename); kclose(handle); @@ -90,13 +90,13 @@ int32 RTS_AddFile (char *filename) header.numlumps = IntelLong(header.numlumps); header.infotableofs = IntelLong(header.infotableofs); length = header.numlumps*sizeof(filelump_t); - fileinfo = fileinfoo = (filelump_t*)malloc (length); + fileinfo = fileinfoo = (filelump_t*)malloc(length); if (!fileinfo) { initprintf("RTS file could not allocate header info\n"); kclose(handle); return -1; } - klseek (handle, header.infotableofs, SEEK_SET); + klseek(handle, header.infotableofs, SEEK_SET); kread(handle, fileinfo, length); // @@ -118,7 +118,7 @@ int32 RTS_AddFile (char *filename) lump_p->handle = handle; lump_p->position = IntelLong(fileinfo->filepos); lump_p->size = IntelLong(fileinfo->size); - strncpy (lump_p->name, fileinfo->name, 8); + strncpy(lump_p->name, fileinfo->name, 8); } free(fileinfoo); @@ -136,7 +136,7 @@ int32 RTS_AddFile (char *filename) ==================== */ -void RTS_Init (char *filename) +void RTS_Init(char *filename) { int32 length; // @@ -146,14 +146,14 @@ void RTS_Init (char *filename) lumpinfo = NULL; // will be realloced as lumps are added initprintf("RTS Manager Started.\n"); - if (RTS_AddFile (filename)) return; + if (RTS_AddFile(filename)) return; if (!numlumps) return; // // set up caching // - length = (numlumps) * sizeof( *lumpcache ); + length = (numlumps) * sizeof(*lumpcache); lumpcache = SafeMalloc(length); memset(lumpcache,0,length); RTS_Started = true; @@ -168,7 +168,7 @@ void RTS_Init (char *filename) ==================== */ -int32 RTS_NumSounds (void) +int32 RTS_NumSounds(void) { return numlumps-1; } @@ -183,11 +183,11 @@ int32 RTS_NumSounds (void) ==================== */ -int32 RTS_SoundLength (int32 lump) +int32 RTS_SoundLength(int32 lump) { lump++; if (lump >= numlumps) - Error ("RTS_SoundLength: %i >= numlumps",lump); + Error("RTS_SoundLength: %i >= numlumps",lump); return lumpinfo[lump].size; } @@ -199,11 +199,11 @@ int32 RTS_SoundLength (int32 lump) ==================== */ -char * RTS_GetSoundName (int32 i) +char * RTS_GetSoundName(int32 i) { i++; if (i>=numlumps) - Error ("RTS_GetSoundName: %i >= numlumps",i); + Error("RTS_GetSoundName: %i >= numlumps",i); return &(lumpinfo[i].name[0]); } @@ -216,16 +216,16 @@ char * RTS_GetSoundName (int32 i) = ==================== */ -void RTS_ReadLump (int32 lump, void *dest) +void RTS_ReadLump(int32 lump, void *dest) { lumpinfo_t *l; if (lump >= numlumps) - Error ("RTS_ReadLump: %i >= numlumps",lump); + Error("RTS_ReadLump: %i >= numlumps",lump); if (lump < 0) - Error ("RTS_ReadLump: %i < 0",lump); + Error("RTS_ReadLump: %i < 0",lump); l = lumpinfo+lump; - klseek (l->handle, l->position, SEEK_SET); + klseek(l->handle, l->position, SEEK_SET); kread(l->handle,dest,l->size); } @@ -236,11 +236,11 @@ void RTS_ReadLump (int32 lump, void *dest) = ==================== */ -void *RTS_GetSound (int32 lump) +void *RTS_GetSound(int32 lump) { lump++; if ((uint32)lump >= (uint32)numlumps) - Error ("RTS_GetSound: %i >= %i\n",lump,numlumps); + Error("RTS_GetSound: %i >= %i\n",lump,numlumps); if (lumpcache[lump] == NULL) { diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index fa0621510..fab19d8b6 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -88,7 +88,7 @@ int loadplayer(signed char spot) return -1; } - if ( multiflag == 2 && multiwho != myconnectindex ) + if (multiflag == 2 && multiwho != myconnectindex) { fnptr = mpfn; mpfn[4] = spot + 'A'; @@ -211,7 +211,7 @@ int loadplayer(signed char spot) if (kdfread(&scriptptrs[0],1,MAXSCRIPTSIZE,fil) != MAXSCRIPTSIZE) goto corrupt; if (kdfread(&script[0],4,MAXSCRIPTSIZE,fil) != MAXSCRIPTSIZE) goto corrupt; for (i=0;i= 0 ) + if (wall[animwall[x].wallnum].extra >= 0) wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra; } else @@ -468,7 +468,7 @@ int saveplayer(signed char spot) waitforeverybody(); - if ( multiflag == 2 && multiwho != myconnectindex ) + if (multiflag == 2 && multiwho != myconnectindex) { fnptr = mpfn; mpfn[4] = spot + 'A'; @@ -547,7 +547,7 @@ int saveplayer(signed char spot) for (i=0;i= (long)(&script[0]) && (long)script[i] < (long)(&script[MAXSCRIPTSIZE]) ) + if ((long)script[i] >= (long)(&script[0]) && (long)script[i] < (long)(&script[MAXSCRIPTSIZE])) { scriptptrs[i] = 1; j = (long)script[i] - (long)&script[0]; @@ -560,7 +560,7 @@ int saveplayer(signed char spot) dfwrite(&script[0],4,MAXSCRIPTSIZE,fil); for (i=0;i= j && T2 < (long)(&script[MAXSCRIPTSIZE]) ) + if (T2 >= j && T2 < (long)(&script[MAXSCRIPTSIZE])) { scriptptrs[i] |= 1; T2 -= j; } - if (T5 >= j && T5 < (long)(&script[MAXSCRIPTSIZE]) ) + if (T5 >= j && T5 < (long)(&script[MAXSCRIPTSIZE])) { scriptptrs[i] |= 2; T5 -= j; } - if (T6 >= j && T6 < (long)(&script[MAXSCRIPTSIZE]) ) + if (T6 >= j && T6 < (long)(&script[MAXSCRIPTSIZE])) { scriptptrs[i] |= 4; T6 -= j; diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 7f4132980..8698cbb22 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -37,13 +37,13 @@ short callsound(short sn,short whatsprite) i = headspritesect[sn]; while (i >= 0) { - if ( PN == MUSICANDSFX && SLT < 1000 ) + if (PN == MUSICANDSFX && SLT < 1000) { if (whatsprite == -1) whatsprite = i; if (T1 == 0) { - if ( (soundm[SLT]&16) == 0) + if ((soundm[SLT]&16) == 0) { if (SLT) { @@ -53,14 +53,14 @@ short callsound(short sn,short whatsprite) T6 = whatsprite; } - if ( (sector[SECT].lotag&0xff) != 22) + if ((sector[SECT].lotag&0xff) != 22) T1 = 1; } } else if (SHT < NUM_SOUNDS) { if (SHT) spritesound(SHT,whatsprite); - if ( (soundm[SLT]&1) || ( SHT && SHT != SLT ) ) + if ((soundm[SLT]&1) || (SHT && SHT != SLT)) stopspritesound(SLT,T6); T6 = whatsprite; T1 = 0; @@ -72,39 +72,39 @@ short callsound(short sn,short whatsprite) return -1; } -short check_activator_motion( short lotag ) +short check_activator_motion(short lotag) { short i, j; spritetype *s; i = headspritestat[8]; - while ( i >= 0 ) + while (i >= 0) { - if ( sprite[i].lotag == lotag ) + if (sprite[i].lotag == lotag) { s = &sprite[i]; - for ( j = animatecnt-1; j >= 0; j-- ) - if ( s->sectnum == animatesect[j] ) - return( 1 ); + for (j = animatecnt-1; j >= 0; j--) + if (s->sectnum == animatesect[j]) + return(1); j = headspritestat[3]; - while ( j >= 0 ) + while (j >= 0) { if (s->sectnum == sprite[j].sectnum) switch (sprite[j].lotag) { case 11: case 30: - if ( hittype[j].temp_data[4] ) - return( 1 ); + if (hittype[j].temp_data[4]) + return(1); break; case 20: case 31: case 32: case 18: - if ( hittype[j].temp_data[0] ) - return( 1 ); + if (hittype[j].temp_data[0]) + return(1); break; } @@ -113,7 +113,7 @@ short check_activator_motion( short lotag ) } i = nextspritestat[i]; } - return( 0 ); + return(0); } char isadoorwall(short dapic) @@ -189,7 +189,7 @@ short checkcursectnums(short sect) { short i; for (i=connecthead;i>=0;i=connectpoint2[i]) - if ( sprite[ps[i].i].sectnum == sect ) return i; + if (sprite[ps[i].i].sectnum == sect) return i; return -1; } @@ -227,7 +227,7 @@ short findplayer(spritetype *s,long *d) for (j=connecthead;j>=0;j=connectpoint2[j]) { x = klabs(ps[j].oposx-s->x) + klabs(ps[j].oposy-s->y) + ((klabs(ps[j].oposz-s->z+(28<<8)))>>4); - if ( x < closest && sprite[ps[j].i].extra > 0 ) + if (x < closest && sprite[ps[j].i].extra > 0) { closest_player = j; closest = x; @@ -251,7 +251,7 @@ short findotherplayer(short p,long *d) { x = klabs(ps[j].oposx-ps[p].posx) + klabs(ps[j].oposy-ps[p].posy) + (klabs(ps[j].oposz-ps[p].posz)>>4); - if ( x < closest ) + if (x < closest) { closest_player = j; closest = x; @@ -281,11 +281,11 @@ void doanimations(void) animategoal[i] = animategoal[animatecnt]; animatevel[i] = animatevel[animatecnt]; animatesect[i] = animatesect[animatecnt]; - if ( sector[animatesect[i]].lotag == 18 || sector[animatesect[i]].lotag == 19 ) + if (sector[animatesect[i]].lotag == 18 || sector[animatesect[i]].lotag == 19) if (animateptr[i] == §or[animatesect[i]].ceilingz) continue; - if ( (sector[dasect].lotag&0xff) != 22 ) + if ((sector[dasect].lotag&0xff) != 22) callsound(dasect,-1); continue; @@ -294,7 +294,7 @@ void doanimations(void) if (v > 0) { a = min(a+v,animategoal[i]); } else { a = max(a+v,animategoal[i]); } - if ( animateptr[i] == §or[animatesect[i]].floorz) + if (animateptr[i] == §or[animatesect[i]].floorz) { for (p=connecthead;p>=0;p=connectpoint2[p]) if (ps[p].cursectnum == dasect) @@ -424,7 +424,7 @@ void animatewalls(void) case SCREENBREAK18__STATIC: case SCREENBREAK19__STATIC: - if ( (TRAND&255) < 16) + if ((TRAND&255) < 16) { animwall[p].tag = wall[i].picnum; wall[i].picnum = SCREENBREAK6; @@ -436,12 +436,12 @@ void animatewalls(void) case SCREENBREAK7__STATIC: case SCREENBREAK8__STATIC: - if (animwall[p].tag >= 0 && wall[i].extra != FEMPIC2 && wall[i].extra != FEMPIC3 ) + if (animwall[p].tag >= 0 && wall[i].extra != FEMPIC2 && wall[i].extra != FEMPIC3) wall[i].picnum = animwall[p].tag; else { wall[i].picnum++; - if (wall[i].picnum == (SCREENBREAK6+3) ) + if (wall[i].picnum == (SCREENBREAK6+3)) wall[i].picnum = SCREENBREAK6; } continue; @@ -467,15 +467,15 @@ void animatewalls(void) else animwall[p].tag+=128; - if ( animwall[p].tag < (128<<4) ) + if (animwall[p].tag < (128<<4)) { - if ( animwall[p].tag&128 ) + if (animwall[p].tag&128) wall[i].overpicnum = W_FORCEFIELD; else wall[i].overpicnum = W_FORCEFIELD+1; } else { - if ( (TRAND&255) < 32 ) + if ((TRAND&255) < 32) animwall[p].tag = 128<<(TRAND&3); else wall[i].overpicnum = W_FORCEFIELD+1; } @@ -496,10 +496,10 @@ char activatewarpelevators(short s,short d) //Parm = sectoreffectornum i = headspritestat[3]; while (i >= 0) { - if ( SLT == 17 ) - if ( SHT == sprite[s].hitag ) - if ( (klabs(sector[sn].floorz-hittype[s].temp_data[2]) > SP) || - (sector[SECT].hitag == (sector[sn].hitag-d) ) ) + if (SLT == 17) + if (SHT == sprite[s].hitag) + if ((klabs(sector[sn].floorz-hittype[s].temp_data[2]) > SP) || + (sector[SECT].hitag == (sector[sn].hitag-d))) break; i = nextspritestat[i]; } @@ -520,8 +520,8 @@ char activatewarpelevators(short s,short d) //Parm = sectoreffectornum i = headspritestat[3]; while (i >= 0) { - if ( SLT == 17 ) - if ( SHT == sprite[s].hitag ) + if (SLT == 17) + if (SHT == sprite[s].hitag) { T1 = d; T2 = d; //Make all check warp @@ -546,7 +546,7 @@ void operatesectors(short sn,short ii) case 30: j = sector[sn].hitag; - if ( hittype[j].tempang == 0 || + if (hittype[j].tempang == 0 || hittype[j].tempang == 256) callsound(sn,ii); if (sprite[j].extra == 1) @@ -672,15 +672,15 @@ void operatesectors(short sn,short ii) i = headspritesect[sn]; while (i >= 0) { - if (PN==SECTOREFFECTOR && SLT == 17 ) break; + if (PN==SECTOREFFECTOR && SLT == 17) break; i = nextspritesect[i]; } if (sprite[ii].sectnum == sn) { - if ( activatewarpelevators(i,-1) ) + if (activatewarpelevators(i,-1)) activatewarpelevators(i,1); - else if ( activatewarpelevators(i,1) ) + else if (activatewarpelevators(i,1)) activatewarpelevators(i,-1); return; } @@ -702,10 +702,10 @@ void operatesectors(short sn,short ii) if (i == -1) { i = nextsectorneighborz(sn,sptr->floorz,1,1); - if ( i == -1 ) + if (i == -1) { i = nextsectorneighborz(sn,sptr->floorz,1,-1); - if ( i == -1 ) return; + if (i == -1) return; j = sector[i].floorz; setanimation(sn,&sptr->floorz,j,sptr->extra); } @@ -748,8 +748,8 @@ void operatesectors(short sn,short ii) i = headspritestat[3]; //Effectors while (i >= 0) { - if ( (SLT == 22) && - (SHT == sptr->hitag) ) + if ((SLT == 22) && + (SHT == sptr->hitag)) { sector[SECT].extra = -sector[SECT].extra; @@ -831,7 +831,7 @@ REDODOOR: // REDODOOR22: - if ( (sptr->lotag&0x8000) ) + if ((sptr->lotag&0x8000)) { q = (sptr->ceilingz+sptr->floorz)>>1; j = setanimation(sn,&sptr->floorz,q,sptr->extra); @@ -859,7 +859,7 @@ REDODOOR: i = headspritestat[3]; while (i >= 0) { - if ( SLT == 11 && SECT == sn && !T5) + if (SLT == 11 && SECT == sn && !T5) { j = i; break; @@ -874,7 +874,7 @@ REDODOOR: i = headspritestat[3]; while (i >= 0) { - if ( l == (sector[SECT].lotag&0x8000) && SLT == 11 && sprite[j].hitag == SHT && !T5 ) + if (l == (sector[SECT].lotag&0x8000) && SLT == 11 && sprite[j].hitag == SHT && !T5) { if (sector[SECT].lotag&0x8000) sector[SECT].lotag &= 0x7fff; else sector[SECT].lotag |= 0x8000; @@ -896,7 +896,7 @@ REDODOOR: j = headspritestat[3]; while (j >= 0)//Find the sprite { - if ( (sprite[j].lotag) == 15 && sprite[j].sectnum == sn ) + if ((sprite[j].lotag) == 15 && sprite[j].sectnum == sn) break; //Found the sectoreffector. j = nextspritestat[j]; } @@ -907,9 +907,9 @@ REDODOOR: i = headspritestat[3]; while (i >= 0) { - if ( SHT==sprite[j].hitag ) + if (SHT==sprite[j].hitag) { - if ( SLT == 15 ) + if (SLT == 15) { sector[SECT].lotag ^= 0x8000; // Toggle the open or close SA += 1024; @@ -928,7 +928,7 @@ REDODOOR: j = headspritestat[3]; while (j >= 0) { - if ( (sprite[j].lotag&0xff)==20 && sprite[j].sectnum == sn) //Bridge + if ((sprite[j].lotag&0xff)==20 && sprite[j].sectnum == sn) //Bridge { sector[sn].lotag ^= 0x8000; @@ -959,8 +959,8 @@ REDODOOR: l = headspritestat[3]; while (l >= 0) { - if ( (sprite[l].lotag&0xff)==21 && !hittype[l].temp_data[0] && - (sprite[l].hitag) == j ) + if ((sprite[l].lotag&0xff)==21 && !hittype[l].temp_data[0] && + (sprite[l].hitag) == j) hittype[l].temp_data[0] = 1; l = nextspritestat[l]; } @@ -980,7 +980,7 @@ void operaterespawns(short low) nexti = nextspritestat[i]; if ((SLT == low) && (PN == RESPAWN)) { - if ( badguypic(SHT) && ud.monsters_off ) break; + if (badguypic(SHT) && ud.monsters_off) break; j = spawn(i,TRANSPORTERSTAR); sprite[j].z -= (32<<8); @@ -1017,7 +1017,7 @@ void operateactivators(short low,short snum) { if (sprite[i].lotag == low) { - if ( sprite[i].picnum == ACTIVATORLOCKED ) + if (sprite[i].picnum == ACTIVATORLOCKED) { if (sector[SECT].lotag&16384) sector[SECT].lotag &= 65535-16384; @@ -1053,12 +1053,12 @@ void operateactivators(short low,short snum) break; } - if ( sector[sprite[i].sectnum].lotag < 3 ) + if (sector[sprite[i].sectnum].lotag < 3) { j = headspritesect[sprite[i].sectnum]; while (j >= 0) { - if ( sprite[j].statnum == 3 ) switch (sprite[j].lotag) + if (sprite[j].statnum == 3) switch (sprite[j].lotag) { case 36: case 31: @@ -1072,7 +1072,7 @@ void operateactivators(short low,short snum) } } - if ( k == -1 && (sector[SECT].lotag&0xff) == 22 ) + if (k == -1 && (sector[SECT].lotag&0xff) == 22) k = callsound(SECT,i); operatesectors(SECT,i); @@ -1091,7 +1091,7 @@ void operatemasterswitches(short low) i = headspritestat[6]; while (i >= 0) { - if ( PN == MASTERSWITCH && SLT == low && SP == 0 ) + if (PN == MASTERSWITCH && SLT == low && SP == 0) SP = 1; i = nextspritestat[i]; } @@ -1111,11 +1111,11 @@ void operateforcefields(short s, short low) animwall[p].tag = 0; - if ( wall[i].cstat ) + if (wall[i].cstat) { wall[i].cstat = 0; - if ( s >= 0 && sprite[s].picnum == SECTOREFFECTOR && + if (s >= 0 && sprite[s].picnum == SECTOREFFECTOR && sprite[s].lotag == 30) wall[i].lotag = 0; } @@ -1156,7 +1156,7 @@ char checkhitswitch(short snum,long w,char switchtype) } // initprintf("checkhitswitch called picnum=%i switchtype=%i\n",picnum,switchtype); switchpicnum = picnum; - if ( (picnum==DIPSWITCH+1) + if ((picnum==DIPSWITCH+1) || (picnum==TECHSWITCH+1) || (picnum==ALIENSWITCH+1) || (picnum==DIPSWITCH2+1) @@ -1193,28 +1193,28 @@ char checkhitswitch(short snum,long w,char switchtype) case ACCESSSWITCH2__STATIC: if (ps[snum].access_incs == 0) { - if ( switchpal == 0 ) + if (switchpal == 0) { - if ( (ps[snum].got_access&1) ) + if ((ps[snum].got_access&1)) ps[snum].access_incs = 1; else FTA(70,&ps[snum]); } - else if ( switchpal == 21 ) + else if (switchpal == 21) { - if ( ps[snum].got_access&2 ) + if (ps[snum].got_access&2) ps[snum].access_incs = 1; else FTA(71,&ps[snum]); } - else if ( switchpal == 23 ) + else if (switchpal == 23) { - if ( ps[snum].got_access&4 ) + if (ps[snum].got_access&4) ps[snum].access_incs = 1; else FTA(72,&ps[snum]); } - if ( ps[snum].access_incs == 1 ) + if (ps[snum].access_incs == 1) { if (switchtype == 0) ps[snum].access_wallnum = w; @@ -1254,10 +1254,10 @@ char checkhitswitch(short snum,long w,char switchtype) //case LOCKSWITCH1+1: case POWERSWITCH2__STATIC: //case POWERSWITCH2+1: - if ( check_activator_motion( lotag ) ) return 0; + if (check_activator_motion(lotag)) return 0; break; default: - if ( isadoorwall(picnum) == 0 ) return 0; + if (isadoorwall(picnum) == 0) return 0; break; } @@ -1265,11 +1265,11 @@ char checkhitswitch(short snum,long w,char switchtype) while (i >= 0) { - if ( lotag == SLT ) { + if (lotag == SLT) { int switchpicnum=PN; // put it in a variable so later switches don't trigger on the result of changes if ((switchpicnum >= MULTISWITCH) && (switchpicnum <=MULTISWITCH+3)) { sprite[i].picnum++; - if ( sprite[i].picnum > (MULTISWITCH+3) ) + if (sprite[i].picnum > (MULTISWITCH+3)) sprite[i].picnum = MULTISWITCH; } @@ -1278,8 +1278,8 @@ char checkhitswitch(short snum,long w,char switchtype) case DIPSWITCH__STATIC: case TECHSWITCH__STATIC: case ALIENSWITCH__STATIC: - if ( switchtype == 1 && w == i ) PN++; - else if ( SHT == 0 ) correctdips++; + if (switchtype == 1 && w == i) PN++; + else if (SHT == 0) correctdips++; numdips++; break; case ACCESSSWITCH__STATIC: @@ -1305,8 +1305,8 @@ char checkhitswitch(short snum,long w,char switchtype) case TECHSWITCH__STATIC: case DIPSWITCH__STATIC: case ALIENSWITCH__STATIC: - if ( switchtype == 1 && w == i ) PN--; - else if ( SHT == 1 ) correctdips++; + if (switchtype == 1 && w == i) PN--; + else if (SHT == 1) correctdips++; numdips++; break; case PULLSWITCH__STATIC: @@ -1337,7 +1337,7 @@ char checkhitswitch(short snum,long w,char switchtype) if (lotag == wall[x].lotag) { if ((wall[x].picnum >= MULTISWITCH) && (wall[x].picnum <=MULTISWITCH+3)) { wall[x].picnum++; - if (wall[x].picnum > (MULTISWITCH+3) ) + if (wall[x].picnum > (MULTISWITCH+3)) wall[x].picnum = MULTISWITCH; } @@ -1346,8 +1346,8 @@ char checkhitswitch(short snum,long w,char switchtype) case DIPSWITCH__STATIC: case TECHSWITCH__STATIC: case ALIENSWITCH__STATIC: - if ( switchtype == 0 && i == w ) wall[x].picnum++; - else if ( wall[x].hitag == 0 ) correctdips++; + if (switchtype == 0 && i == w) wall[x].picnum++; + else if (wall[x].hitag == 0) correctdips++; numdips++; break; case ACCESSSWITCH__STATIC: @@ -1373,8 +1373,8 @@ char checkhitswitch(short snum,long w,char switchtype) case TECHSWITCH__STATIC: case DIPSWITCH__STATIC: case ALIENSWITCH__STATIC: - if ( switchtype == 0 && i == w ) wall[x].picnum--; - else if ( wall[x].hitag == 1 ) correctdips++; + if (switchtype == 0 && i == w) wall[x].picnum--; + else if (wall[x].hitag == 1) correctdips++; numdips++; break; case PULLSWITCH__STATIC: @@ -1411,7 +1411,7 @@ char checkhitswitch(short snum,long w,char switchtype) else { ud.level_number++; - if ( (ud.volume_number && ud.level_number > 10 ) || ( ud.volume_number == 0 && ud.level_number > 5 ) ) + if ((ud.volume_number && ud.level_number > 10) || (ud.volume_number == 0 && ud.level_number > 5)) ud.level_number = 0; ud.m_level_number = ud.level_number; } @@ -1421,7 +1421,7 @@ char checkhitswitch(short snum,long w,char switchtype) switchpicnum = picnum; - if ( (picnum==DIPSWITCH+1) + if ((picnum==DIPSWITCH+1) || (picnum==TECHSWITCH+1) || (picnum==ALIENSWITCH+1) || (picnum==DIPSWITCH2+1) @@ -1455,11 +1455,11 @@ char checkhitswitch(short snum,long w,char switchtype) //case TECHSWITCH+1: case ALIENSWITCH__STATIC: //case ALIENSWITCH+1: - if ( picnum == DIPSWITCH || picnum == DIPSWITCH+1 || + if (picnum == DIPSWITCH || picnum == DIPSWITCH+1 || picnum == ALIENSWITCH || picnum == ALIENSWITCH+1 || - picnum == TECHSWITCH || picnum == TECHSWITCH+1 ) + picnum == TECHSWITCH || picnum == TECHSWITCH+1) { - if ( picnum == ALIENSWITCH || picnum == ALIENSWITCH+1) + if (picnum == ALIENSWITCH || picnum == ALIENSWITCH+1) { if (switchtype == 1) xyzsound(ALIEN_SWITCH1,w,sx,sy,ps[snum].posz); @@ -1507,14 +1507,14 @@ char checkhitswitch(short snum,long w,char switchtype) case PULLSWITCH__STATIC: //case PULLSWITCH+1: - if ( picnum == MULTISWITCH || picnum == (MULTISWITCH+1) || - picnum == (MULTISWITCH+2) || picnum == (MULTISWITCH+3) ) + if (picnum == MULTISWITCH || picnum == (MULTISWITCH+1) || + picnum == (MULTISWITCH+2) || picnum == (MULTISWITCH+3)) lotag += picnum-MULTISWITCH; x = headspritestat[3]; while (x >= 0) { - if ( ((sprite[x].hitag) == lotag) ) + if (((sprite[x].hitag) == lotag)) { switch (sprite[x].lotag) { @@ -1545,11 +1545,11 @@ char checkhitswitch(short snum,long w,char switchtype) operateforcefields(ps[snum].i,lotag); operatemasterswitches(lotag); - if ( picnum == DIPSWITCH || picnum == DIPSWITCH+1 || + if (picnum == DIPSWITCH || picnum == DIPSWITCH+1 || picnum == ALIENSWITCH || picnum == ALIENSWITCH+1 || - picnum == TECHSWITCH || picnum == TECHSWITCH+1 ) return 1; + picnum == TECHSWITCH || picnum == TECHSWITCH+1) return 1; - if ( hitag == 0 && isadoorwall(picnum) == 0 ) + if (hitag == 0 && isadoorwall(picnum) == 0) { if (switchtype == 1) xyzsound(SWITCH_ON,w,sx,sy,ps[snum].posz); @@ -1632,9 +1632,9 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) } } - if ( ( (wal->cstat&16) || wal->overpicnum == BIGFORCE ) && wal->nextsector >= 0 ) - if ( sector[wal->nextsector].floorz > z ) - if ( sector[wal->nextsector].floorz-sector[wal->nextsector].ceilingz ) + if (((wal->cstat&16) || wal->overpicnum == BIGFORCE) && wal->nextsector >= 0) + if (sector[wal->nextsector].floorz > z) + if (sector[wal->nextsector].floorz-sector[wal->nextsector].ceilingz) { int switchpicnum = wal->overpicnum; if ((switchpicnum > W_FORCEFIELD)&&(switchpicnum <= W_FORCEFIELD+2)) @@ -1647,7 +1647,7 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) wal->extra = 1; // tell the forces to animate case BIGFORCE__STATIC: updatesector(x,y,&sn); - if ( sn < 0 ) return; + if (sn < 0) return; if (atwith == -1) i = EGS(sn,x,y,z,FORCERIPPLE,-127,8,8,0,0,0,spr,5); @@ -1679,7 +1679,7 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) return; case GLASS__STATIC: - updatesector(x,y,&sn); if ( sn < 0 ) return; + updatesector(x,y,&sn); if (sn < 0) return; wal->overpicnum=GLASS2; lotsofglass(spr,dawallnum,10); wal->cstat = 0; @@ -1692,7 +1692,7 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) spritesound(GLASS_BREAKING,i); return; case STAINGLASS1__STATIC: - updatesector(x,y,&sn); if ( sn < 0 ) return; + updatesector(x,y,&sn); if (sn < 0) return; lotsofcolourglass(spr,dawallnum,80); wal->cstat = 0; if (wal->nextwall >= 0) @@ -1799,7 +1799,7 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) case TECHLIGHT2__STATIC: case TECHLIGHT4__STATIC: - if ( rnd(128) ) + if (rnd(128)) spritesound(GLASS_HEAVYBREAK,spr); else spritesound(GLASS_BREAKING,spr); lotsofglass(spr,dawallnum,30); @@ -1837,7 +1837,7 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) i= headspritestat[3]; while (i >= 0) { - if (SHT == wall[dawallnum].lotag && SLT == 3 ) + if (SHT == wall[dawallnum].lotag && SLT == 3) { T3 = j; T4 = darkestwall; @@ -1851,13 +1851,13 @@ void checkhitwall(short spr,short dawallnum,long x,long y,long z,short atwith) void checkplayerhurt(struct player_struct *p,short j) { - if ( (j&49152) == 49152 ) + if ((j&49152) == 49152) { j &= (MAXSPRITES-1); if (sprite[j].picnum==CACTUS){ - if (p->hurt_delay < 8 ) + if (p->hurt_delay < 8) { sprite[p->i].extra -= 5; @@ -1873,11 +1873,11 @@ void checkplayerhurt(struct player_struct *p,short j) return; } - if ( (j&49152) != 32768) return; + if ((j&49152) != 32768) return; j &= (MAXWALLS-1); - if ( p->hurt_delay > 0 ) p->hurt_delay--; - else if ( wall[j].cstat&85 ) { + if (p->hurt_delay > 0) p->hurt_delay--; + else if (wall[j].cstat&85) { int switchpicnum = wall[j].overpicnum; if ((switchpicnum>W_FORCEFIELD)&&(switchpicnum<=W_FORCEFIELD+2)) switchpicnum=W_FORCEFIELD; @@ -1958,12 +1958,12 @@ char checkhitceiling(short sn) i = headspritesect[sn]; while (i >= 0) { - if ( PN == SECTOREFFECTOR && SLT == 12 ) + if (PN == SECTOREFFECTOR && SLT == 12) { j = headspritestat[3]; while (j >= 0) { - if ( sprite[j].hitag == SHT ) + if (sprite[j].hitag == SHT) hittype[j].temp_data[3] = 1; j = nextspritestat[j]; } @@ -1977,7 +1977,7 @@ char checkhitceiling(short sn) j = TRAND&1; while (i >= 0) { - if (SHT == (sector[sn].hitag) && SLT == 3 ) + if (SHT == (sector[sn].hitag) && SLT == 3) { T3 = j; T5 = 1; @@ -2028,7 +2028,7 @@ void checkhitsprite(short i,short sn) } else { - if ( TRAND&3 ) + if (TRAND&3) { sprite[i].xvel = 164; sprite[i].ang = sprite[sn].ang; @@ -2112,7 +2112,7 @@ void checkhitsprite(short i,short sn) case FANSPRITE__STATIC: PN = FANSPRITEBROKE; CS &= (65535-257); - if ( sector[SECT].floorpicnum == FANSHADOW ) + if (sector[SECT].floorpicnum == FANSHADOW) sector[SECT].floorpicnum = FANSHADOWBROKE; spritesound(GLASS_HEAVYBREAK,i); @@ -2131,7 +2131,7 @@ void checkhitsprite(short i,short sn) case FUELPOD__STATIC: case SOLARPANNEL__STATIC: case ANTENNA__STATIC: - if (sprite[sn].extra != *actorscrptr[SHOTSPARK1] ) + if (sprite[sn].extra != *actorscrptr[SHOTSPARK1]) { for (j=0;j<15;j++) EGS(SECT,SX,SY,sector[SECT].floorz-(12<<8)-(j<<9),SCRAP1+(TRAND&15),-8,64,64, @@ -2358,18 +2358,18 @@ void checkhitsprite(short i,short sn) case PLAYERONWATER__STATIC: i = OW; default: - if ( (sprite[i].cstat&16) && SHT == 0 && SLT == 0 && sprite[i].statnum == 0) + if ((sprite[i].cstat&16) && SHT == 0 && SLT == 0 && sprite[i].statnum == 0) break; - if ( ( sprite[sn].picnum == FREEZEBLAST || sprite[sn].owner != i ) && sprite[i].statnum != 4) + if ((sprite[sn].picnum == FREEZEBLAST || sprite[sn].owner != i) && sprite[i].statnum != 4) { - if ( badguy(&sprite[i]) == 1) + if (badguy(&sprite[i]) == 1) { if (sprite[sn].picnum == RPG) sprite[sn].extra <<= 1; - if ( (PN != DRONE) && (PN != ROTATEGUN) && (PN != COMMANDER) && (PN < GREENSLIME || PN > GREENSLIME+7) ) - if (sprite[sn].picnum != FREEZEBLAST ) - if ( actortype[PN] == 0 ) + if ((PN != DRONE) && (PN != ROTATEGUN) && (PN != COMMANDER) && (PN < GREENSLIME || PN > GREENSLIME+7)) + if (sprite[sn].picnum != FREEZEBLAST) + if (actortype[PN] == 0) { j = spawn(sn,JIBS6); if (sprite[sn].pal == 6) @@ -2382,8 +2382,8 @@ void checkhitsprite(short i,short sn) j = sprite[sn].owner; - if ( j >= 0 && sprite[j].picnum == APLAYER && PN != ROTATEGUN && PN != DRONE ) - if ( ps[sprite[j].yvel].curr_weapon == SHOTGUN_WEAPON ) + if (j >= 0 && sprite[j].picnum == APLAYER && PN != ROTATEGUN && PN != DRONE) + if (ps[sprite[j].yvel].curr_weapon == SHOTGUN_WEAPON) { shoot(i,BLOODSPLAT3); shoot(i,BLOODSPLAT1); @@ -2391,9 +2391,9 @@ void checkhitsprite(short i,short sn) shoot(i,BLOODSPLAT4); } - if ( PN != TANK && PN != BOSS1 && PN != BOSS4 && PN != BOSS2 && PN != BOSS3 && PN != RECON && PN != ROTATEGUN ) + if (PN != TANK && PN != BOSS1 && PN != BOSS4 && PN != BOSS2 && PN != BOSS3 && PN != RECON && PN != ROTATEGUN) { - if ( (sprite[i].cstat&48) == 0 ) + if ((sprite[i].cstat&48) == 0) SA = (sprite[sn].ang+1024)&2047; sprite[i].xvel = -(sprite[sn].extra<<2); j = SECT; @@ -2407,12 +2407,12 @@ void checkhitsprite(short i,short sn) changespritestat(i,1); hittype[i].timetosleep = SLEEPTIME; } - if ( ( RX < 24 || PN == SHARK) && sprite[sn].picnum == SHRINKSPARK) return; + if ((RX < 24 || PN == SHARK) && sprite[sn].picnum == SHRINKSPARK) return; } - if ( sprite[i].statnum != 2 ) + if (sprite[i].statnum != 2) { - if ( sprite[sn].picnum == FREEZEBLAST && ( (PN == APLAYER && sprite[i].pal == 1 ) || ( freezerhurtowner == 0 && sprite[sn].owner == i ) ) ) + if (sprite[sn].picnum == FREEZEBLAST && ((PN == APLAYER && sprite[i].pal == 1) || (freezerhurtowner == 0 && sprite[sn].owner == i))) return; hittype[i].picnum = sprite[sn].picnum; @@ -2443,10 +2443,10 @@ void checkhitsprite(short i,short sn) } } - if ( RX < 24 && sprite[sn].picnum == SHRINKSPARK) + if (RX < 24 && sprite[sn].picnum == SHRINKSPARK) return; - if ( sprite[hittype[i].owner].picnum != APLAYER) + if (sprite[hittype[i].owner].picnum != APLAYER) if (ud.player_skill >= 3) sprite[sn].extra += (sprite[sn].extra>>1); } @@ -2463,13 +2463,13 @@ void allignwarpelevators(void) i = headspritestat[3]; while (i >= 0) { - if ( SLT == 17 && SS > 16) + if (SLT == 17 && SS > 16) { j = headspritestat[3]; while (j >= 0) { - if ( (sprite[j].lotag) == 17 && i != j && - (SHT) == (sprite[j].hitag) ) + if ((sprite[j].lotag) == 17 && i != j && + (SHT) == (sprite[j].hitag)) { sector[sprite[j].sectnum].floorz = sector[SECT].floorz; @@ -2531,12 +2531,12 @@ void cheatkeys(short snum) if (p->aim_mode < i) p->return_to_center = 9; - if ( (sb_snum&(1<<22)) && p->quick_kick == 0) - if ( p->curr_weapon != KNEE_WEAPON || p->kickback_pic == 0 ) + if ((sb_snum&(1<<22)) && p->quick_kick == 0) + if (p->curr_weapon != KNEE_WEAPON || p->kickback_pic == 0) { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_QUICKKICK,ps[snum].i,snum, -1); - if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0 ) + if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0) { p->quick_kick = 14; FTA(80,p); @@ -2548,11 +2548,11 @@ void cheatkeys(short snum) p->interface_toggle_flag |= sb_snum | ((sb_snum&0xf00)?0xf00:0); p->interface_toggle_flag &= j | ((j&0xf00)?0xf00:0); - if (sb_snum && ( sb_snum&(1<<17) ) == 0) + if (sb_snum && (sb_snum&(1<<17)) == 0) { - if ( sb_snum&(1<<21) ) + if (sb_snum&(1<<21)) { - KB_ClearKeyDown( sc_Pause ); + KB_ClearKeyDown(sc_Pause); if (ud.pause_on) ud.pause_on = 0; else ud.pause_on = 1+SHIFTS_IS_PRESSED; @@ -2574,11 +2574,11 @@ void cheatkeys(short snum) if (sprite[p->i].extra <= 0) return; // if dead... - if ( sb_snum&(1<<30) && p->newowner == -1 ) // inventory button generates event for selected item + if (sb_snum&(1<<30) && p->newowner == -1) // inventory button generates event for selected item { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_INVENTORY,ps[snum].i,snum, -1); - if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0 ) + if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0) { switch (p->inven_icon) { @@ -2596,7 +2596,7 @@ void cheatkeys(short snum) } } - if ( sb_snum&(1<<15) ) + if (sb_snum&(1<<15)) { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_USENIGHTVISION,ps[snum].i,snum, -1); @@ -2611,13 +2611,13 @@ void cheatkeys(short snum) } } - if ( (sb_snum&(1<<12)) ) + if ((sb_snum&(1<<12))) { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_USESTEROIDS,ps[snum].i,snum, -1); if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0) { - if (p->steroids_amount == 400 ) + if (p->steroids_amount == 400) { p->steroids_amount--; spritesound(DUKE_TAKEPILLS,p->i); @@ -2632,11 +2632,11 @@ void cheatkeys(short snum) sb_snum|=(1<<20); // emulate move left... } if (p->newowner == -1) - if ( sb_snum&(1<<20) || sb_snum&(1<<27)) + if (sb_snum&(1<<20) || sb_snum&(1<<27)) { p->invdisptime = 26*2; - if ( sb_snum&(1<<27) ) k = 1; + if (sb_snum&(1<<27)) k = 1; else k = 0; if (p->refresh_inventory) p->refresh_inventory = 0; @@ -2698,13 +2698,13 @@ CHECKINV1: } else dainv = 0; - if ( sb_snum&(1<<20) ) // Inventory_Left + if (sb_snum&(1<<20)) // Inventory_Left { SetGameVarID(g_iReturnVarID,dainv,ps[snum].i,snum); OnEvent(EVENT_INVENTORYLEFT,ps[snum].i,snum, -1); dainv=GetGameVarID(g_iReturnVarID,ps[snum].i,snum); } - if ( sb_snum&(1<<27) ) // Inventory_Right + if (sb_snum&(1<<27)) // Inventory_Right { SetGameVarID(g_iReturnVarID,dainv,ps[snum].i,snum); OnEvent(EVENT_INVENTORYRIGHT,ps[snum].i,snum, -1); @@ -2732,7 +2732,7 @@ CHECKINV1: } } - j = ( (sb_snum&(15<<8))>>8 ) - 1; + j = ((sb_snum&(15<<8))>>8) - 1; SetGameVarID(g_iReturnVarID,j,p->i,snum); @@ -2781,22 +2781,22 @@ CHECKINV1: if (p->reloading == 1) j = -1; - else if ( j > 0 && p->kickback_pic == 1 && p->weapon_pos == 1) + else if (j > 0 && p->kickback_pic == 1 && p->weapon_pos == 1) { p->wantweaponfire = j; p->kickback_pic = 0; } - if (p->last_pissed_time <= (26*218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0 ) + if (p->last_pissed_time <= (26*218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0) { // if( ( p->weapon_pos == 0 || ( p->holster_weapon && p->weapon_pos == -9 ) )) { if (j == 10 || j == 11) { k = p->curr_weapon; - j = ( j == 10 ? -1 : 1 ); // JBF: prev (-1) or next (1) weapon choice + j = (j == 10 ? -1 : 1); // JBF: prev (-1) or next (1) weapon choice i = 0; - while ( ( k >= 0 && k < 10 ) || ( PLUTOPAK && k == GROW_WEAPON && (p->subweapon&(1<= 0 && k < 10) || (PLUTOPAK && k == GROW_WEAPON && (p->subweapon&(1<subweapon&(1<subweapon&(1<gotweapon[k] && p->ammo_amount[k] > 0 ) + if (p->gotweapon[k] && p->ammo_amount[k] > 0) { if (PLUTOPAK) // JBF 20040116: so we don't select grower with v1.3d - if ( k == SHRINKER_WEAPON && (p->subweapon&(1<subweapon&(1<i,snum, -1); if (GetGameVarID(g_iReturnVarID,p->i,snum) == 0) { - if ( j == HANDBOMB_WEAPON && p->ammo_amount[HANDBOMB_WEAPON] == 0 ) + if (j == HANDBOMB_WEAPON && p->ammo_amount[HANDBOMB_WEAPON] == 0) { k = headspritestat[1]; while (k >= 0) { - if ( sprite[k].picnum == HEAVYHBOMB && sprite[k].owner == p->i ) + if (sprite[k].picnum == HEAVYHBOMB && sprite[k].owner == p->i) { p->gotweapon[HANDBOMB_WEAPON] = 1; j = HANDREMOTE_WEAPON; @@ -2874,11 +2874,11 @@ CHECKINV1: { if (screenpeek == snum) pus = NUMPAGES; - if ( p->curr_weapon != GROW_WEAPON && p->curr_weapon != SHRINKER_WEAPON ) + if (p->curr_weapon != GROW_WEAPON && p->curr_weapon != SHRINKER_WEAPON) { - if ( p->ammo_amount[GROW_WEAPON] > 0 ) + if (p->ammo_amount[GROW_WEAPON] > 0) { - if ( (p->subweapon&(1<subweapon&(1<ammo_amount[SHRINKER_WEAPON] == 0) { @@ -2886,10 +2886,10 @@ CHECKINV1: p->subweapon |= (1<ammo_amount[SHRINKER_WEAPON] > 0 ) + else if (p->ammo_amount[SHRINKER_WEAPON] > 0) p->subweapon &= ~(1<curr_weapon == SHRINKER_WEAPON ) + else if (p->curr_weapon == SHRINKER_WEAPON) { p->subweapon |= (1<weapon_pos = -9; } - else if ( (long)j >= 0 && p->gotweapon[j] && (unsigned long)p->curr_weapon != j ) + else if ((long)j >= 0 && p->gotweapon[j] && (unsigned long)p->curr_weapon != j) switch (j) { case KNEE_WEAPON: - addweapon( p, KNEE_WEAPON ); + addweapon(p, KNEE_WEAPON); break; case PISTOL_WEAPON: - if ( p->ammo_amount[PISTOL_WEAPON] == 0 ) + if (p->ammo_amount[PISTOL_WEAPON] == 0) if (p->show_empty_weapon == 0) { p->last_full_weapon = p->curr_weapon; p->show_empty_weapon = 32; } - addweapon( p, PISTOL_WEAPON ); + addweapon(p, PISTOL_WEAPON); break; case SHOTGUN_WEAPON: - if ( p->ammo_amount[SHOTGUN_WEAPON] == 0 && p->show_empty_weapon == 0) + if (p->ammo_amount[SHOTGUN_WEAPON] == 0 && p->show_empty_weapon == 0) { p->last_full_weapon = p->curr_weapon; p->show_empty_weapon = 32; } - addweapon( p, SHOTGUN_WEAPON); + addweapon(p, SHOTGUN_WEAPON); break; case CHAINGUN_WEAPON: - if ( p->ammo_amount[CHAINGUN_WEAPON] == 0 && p->show_empty_weapon == 0) + if (p->ammo_amount[CHAINGUN_WEAPON] == 0 && p->show_empty_weapon == 0) { p->last_full_weapon = p->curr_weapon; p->show_empty_weapon = 32; } - addweapon( p, CHAINGUN_WEAPON); + addweapon(p, CHAINGUN_WEAPON); break; case RPG_WEAPON: - if ( p->ammo_amount[RPG_WEAPON] == 0 ) + if (p->ammo_amount[RPG_WEAPON] == 0) if (p->show_empty_weapon == 0) { p->last_full_weapon = p->curr_weapon; p->show_empty_weapon = 32; } - addweapon( p, RPG_WEAPON ); + addweapon(p, RPG_WEAPON); break; case DEVISTATOR_WEAPON: - if ( p->ammo_amount[DEVISTATOR_WEAPON] == 0 && p->show_empty_weapon == 0 ) + if (p->ammo_amount[DEVISTATOR_WEAPON] == 0 && p->show_empty_weapon == 0) { p->last_full_weapon = p->curr_weapon; p->show_empty_weapon = 32; } - addweapon( p, DEVISTATOR_WEAPON ); + addweapon(p, DEVISTATOR_WEAPON); break; case FREEZE_WEAPON: - if ( p->ammo_amount[FREEZE_WEAPON] == 0 && p->show_empty_weapon == 0) + if (p->ammo_amount[FREEZE_WEAPON] == 0 && p->show_empty_weapon == 0) { p->last_full_weapon = p->curr_weapon; p->show_empty_weapon = 32; } - addweapon( p, FREEZE_WEAPON ); + addweapon(p, FREEZE_WEAPON); break; case GROW_WEAPON: case SHRINKER_WEAPON: - if ( p->ammo_amount[j] == 0 && p->show_empty_weapon == 0) + if (p->ammo_amount[j] == 0 && p->show_empty_weapon == 0) { p->show_empty_weapon = 32; p->last_full_weapon = p->curr_weapon; @@ -2979,20 +2979,20 @@ CHECKINV1: } break; case HANDBOMB_WEAPON: - if ( p->ammo_amount[HANDBOMB_WEAPON] > 0 && p->gotweapon[HANDBOMB_WEAPON] ) - addweapon( p, HANDBOMB_WEAPON ); + if (p->ammo_amount[HANDBOMB_WEAPON] > 0 && p->gotweapon[HANDBOMB_WEAPON]) + addweapon(p, HANDBOMB_WEAPON); break; case TRIPBOMB_WEAPON: - if ( p->ammo_amount[TRIPBOMB_WEAPON] > 0 && p->gotweapon[TRIPBOMB_WEAPON] ) - addweapon( p, TRIPBOMB_WEAPON ); + if (p->ammo_amount[TRIPBOMB_WEAPON] > 0 && p->gotweapon[TRIPBOMB_WEAPON]) + addweapon(p, TRIPBOMB_WEAPON); break; } } } - if ( sb_snum&(1<<19) ) + if (sb_snum&(1<<19)) { - if ( p->curr_weapon > KNEE_WEAPON ) + if (p->curr_weapon > KNEE_WEAPON) { if (p->holster_weapon == 0 && p->weapon_pos == 0) { @@ -3010,17 +3010,17 @@ CHECKINV1: } } - if ( sb_snum&(1<<24) && p->newowner == -1 ) + if (sb_snum&(1<<24) && p->newowner == -1) { - if ( p->holoduke_on == -1 ) + if (p->holoduke_on == -1) { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_HOLODUKEON,ps[snum].i,snum, -1); if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0) { - if ( p->holoduke_amount > 0 ) + if (p->holoduke_amount > 0) { p->inven_icon = 3; @@ -3052,13 +3052,13 @@ CHECKINV1: } } - if ( sb_snum&(1<<16) ) + if (sb_snum&(1<<16)) { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_USEMEDKIT,ps[snum].i,snum, -1); if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0) { - if ( p->firstaid_amount > 0 && sprite[p->i].extra < max_player_health ) + if (p->firstaid_amount > 0 && sprite[p->i].extra < max_player_health) { j = max_player_health-sprite[p->i].extra; @@ -3079,13 +3079,13 @@ CHECKINV1: } } - if ( sb_snum&(1<<25) && p->newowner == -1) + if (sb_snum&(1<<25) && p->newowner == -1) { SetGameVarID(g_iReturnVarID,0,ps[snum].i,snum); OnEvent(EVENT_USEJETPACK,ps[snum].i,snum, -1); if (GetGameVarID(g_iReturnVarID,ps[snum].i,snum) == 0) { - if ( p->jetpack_amount > 0 ) + if (p->jetpack_amount > 0) { p->jetpack_on = !p->jetpack_on; if (p->jetpack_on) @@ -3157,7 +3157,7 @@ void checksectors(short snum) else { ud.level_number++; - if ( (ud.volume_number && ud.level_number > 10 ) || ( ud.volume_number == 0 && ud.level_number > 5 ) ) + if ((ud.volume_number && ud.level_number > 10) || (ud.volume_number == 0 && ud.level_number > 5)) ud.level_number = 0; ud.m_level_number = ud.level_number; } @@ -3190,27 +3190,27 @@ void checksectors(short snum) sync[snum].bits &= ~(1<<29); } - if ( ud.cashman && sync[snum].bits&(1<<29) ) + if (ud.cashman && sync[snum].bits&(1<<29)) lotsofmoney(&sprite[p->i],2); if (p->newowner >= 0) { - if ( klabs(sync[snum].svel) > 768 || klabs(sync[snum].fvel) > 768 ) + if (klabs(sync[snum].svel) > 768 || klabs(sync[snum].fvel) > 768) { i = -1; goto CLEARCAMERAS; } } - if ( !(sync[snum].bits&(1<<29)) && !(sync[snum].bits&(1<<31))) + if (!(sync[snum].bits&(1<<29)) && !(sync[snum].bits&(1<<31))) p->toggle_key_flag = 0; else if (!p->toggle_key_flag) { - if ( (sync[snum].bits&(1<<31)) ) + if ((sync[snum].bits&(1<<31))) { - if ( p->newowner >= 0 ) + if (p->newowner >= 0) { i = -1; goto CLEARCAMERAS; @@ -3225,13 +3225,13 @@ void checksectors(short snum) i = hitawall(p,&hitscanwall); if (i < 1280 && hitscanwall >= 0 && wall[hitscanwall].overpicnum == MIRROR) - if ( wall[hitscanwall].lotag > 0 && !isspritemakingsound(p->i,wall[hitscanwall].lotag) && snum == screenpeek) + if (wall[hitscanwall].lotag > 0 && !isspritemakingsound(p->i,wall[hitscanwall].lotag) && snum == screenpeek) { spritesound(wall[hitscanwall].lotag,p->i); return; } - if (hitscanwall >= 0 && (wall[hitscanwall].cstat&16) ) + if (hitscanwall >= 0 && (wall[hitscanwall].cstat&16)) switch (wall[hitscanwall].overpicnum) { default: @@ -3279,15 +3279,15 @@ void checksectors(short snum) } } - if (p->newowner == -1 && neartagsprite == -1 && neartagsector == -1 && neartagwall == -1 ) - if ( isanunderoperator(sector[sprite[p->i].sectnum].lotag) ) + if (p->newowner == -1 && neartagsprite == -1 && neartagsector == -1 && neartagwall == -1) + if (isanunderoperator(sector[sprite[p->i].sectnum].lotag)) neartagsector = sprite[p->i].sectnum; - if ( neartagsector >= 0 && (sector[neartagsector].lotag&16384) ) + if (neartagsector >= 0 && (sector[neartagsector].lotag&16384)) return; - if ( neartagsprite == -1 && neartagwall == -1) - if (sector[p->cursectnum].lotag == 2 ) + if (neartagsprite == -1 && neartagwall == -1) + if (sector[p->cursectnum].lotag == 2) { oldz = hitasprite(p->i,&neartagsprite); if (oldz > 1280) neartagsprite = -1; @@ -3295,7 +3295,7 @@ void checksectors(short snum) if (neartagsprite >= 0) { - if ( checkhitswitch(snum,neartagsprite,1) ) return; + if (checkhitswitch(snum,neartagsprite,1)) return; switch (dynamictostatic[sprite[neartagsprite].picnum]) { @@ -3312,12 +3312,12 @@ void checksectors(short snum) p->holster_weapon = 1; p->weapon_pos = -1; } - if (sprite[p->i].extra <= (max_player_health-(max_player_health/10) ) ) + if (sprite[p->i].extra <= (max_player_health-(max_player_health/10))) { sprite[p->i].extra += max_player_health/10; p->last_extra = sprite[p->i].extra; } - else if (sprite[p->i].extra < max_player_health ) + else if (sprite[p->i].extra < max_player_health) sprite[p->i].extra = max_player_health; } else if (!isspritemakingsound(neartagsprite,FLUSH_TOILET)) @@ -3374,7 +3374,7 @@ void checksectors(short snum) while (i >= 0) { - if ( PN == CAMERA1 && SP == 0 && sprite[neartagsprite].hitag == SLT ) + if (PN == CAMERA1 && SP == 0 && sprite[neartagsprite].hitag == SLT) { SP = 1; //Using this camera spritesound(MONITOR_ACTIVE,neartagsprite); @@ -3420,28 +3420,28 @@ CLEARCAMERAS: else if (p->newowner >= 0) p->newowner = -1; - if ( KB_KeyPressed(sc_Escape) ) + if (KB_KeyPressed(sc_Escape)) KB_ClearKeyDown(sc_Escape); return; } } - if ( (sync[snum].bits&(1<<29)) == 0 ) return; + if ((sync[snum].bits&(1<<29)) == 0) return; else if (p->newowner >= 0) { i = -1; goto CLEARCAMERAS; } if (neartagwall == -1 && neartagsector == -1 && neartagsprite == -1) - if ( klabs(hits(p->i)) < 512 ) + if (klabs(hits(p->i)) < 512) { - if ( (TRAND&255) < 16 ) + if ((TRAND&255) < 16) spritesound(DUKE_SEARCH2,p->i); else spritesound(DUKE_SEARCH,p->i); return; } - if ( neartagwall >= 0 ) + if (neartagwall >= 0) { - if ( wall[neartagwall].lotag > 0 && isadoorwall(wall[neartagwall].picnum) ) + if (wall[neartagwall].lotag > 0 && isadoorwall(wall[neartagwall].picnum)) { if (hitscanwall == neartagwall || hitscanwall == -1) checkhitswitch(snum,neartagwall,0); @@ -3454,20 +3454,20 @@ CLEARCAMERAS: } } - if ( neartagsector >= 0 && (sector[neartagsector].lotag&16384) == 0 && isanearoperator(sector[neartagsector].lotag) ) + if (neartagsector >= 0 && (sector[neartagsector].lotag&16384) == 0 && isanearoperator(sector[neartagsector].lotag)) { i = headspritesect[neartagsector]; while (i >= 0) { - if ( PN == ACTIVATOR || PN == MASTERSWITCH ) + if (PN == ACTIVATOR || PN == MASTERSWITCH) return; i = nextspritesect[i]; } operatesectors(neartagsector,p->i); } - else if ( (sector[sprite[p->i].sectnum].lotag&16384) == 0 ) + else if ((sector[sprite[p->i].sectnum].lotag&16384) == 0) { - if ( isanunderoperator(sector[sprite[p->i].sectnum].lotag) ) + if (isanunderoperator(sector[sprite[p->i].sectnum].lotag)) { i = headspritesect[sprite[p->i].sectnum]; while (i >= 0) diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index 176ee8a58..3ae68b364 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -42,24 +42,24 @@ long backflag,numenvsnds; =================== */ -void SoundStartup( void ) +void SoundStartup(void) { int32 status; // if they chose None lets return if (FXDevice < 0) return; - status = FX_Init( FXDevice, NumVoices, NumChannels, NumBits, MixRate ); - if ( status == FX_Ok ) { - FX_SetVolume( FXVolume ); + status = FX_Init(FXDevice, NumVoices, NumChannels, NumBits, MixRate); + if (status == FX_Ok) { + FX_SetVolume(FXVolume); if (ReverseStereo == 1) { FX_SetReverseStereo(!FX_GetReverseStereo()); } - status = FX_SetCallBack( testcallback ); + status = FX_SetCallBack(testcallback); } - if ( status != FX_Ok ) { - sprintf(tempbuf, "Sound startup error: %s", FX_ErrorString( FX_Error )); + if (status != FX_Ok) { + sprintf(tempbuf, "Sound startup error: %s", FX_ErrorString(FX_Error)); gameexit(tempbuf); } } @@ -72,7 +72,7 @@ void SoundStartup( void ) =================== */ -void SoundShutdown( void ) +void SoundShutdown(void) { int32 status; @@ -81,8 +81,8 @@ void SoundShutdown( void ) return; status = FX_Shutdown(); - if ( status != FX_Ok ) { - sprintf(tempbuf, "Sound shutdown error: %s", FX_ErrorString( FX_Error )); + if (status != FX_Ok) { + sprintf(tempbuf, "Sound shutdown error: %s", FX_ErrorString(FX_Error)); gameexit(tempbuf); } } @@ -95,7 +95,7 @@ void SoundShutdown( void ) =================== */ -void MusicStartup( void ) +void MusicStartup(void) { int32 status; @@ -103,11 +103,11 @@ void MusicStartup( void ) if (MusicDevice < 0) return; - status = MUSIC_Init( MusicDevice, 0 ); + status = MUSIC_Init(MusicDevice, 0); - if ( status == MUSIC_Ok ) + if (status == MUSIC_Ok) { - MUSIC_SetVolume( MusicVolume ); + MUSIC_SetVolume(MusicVolume); } else { @@ -133,7 +133,7 @@ void MusicStartup( void ) =================== */ -void MusicShutdown( void ) +void MusicShutdown(void) { int32 status; @@ -142,9 +142,9 @@ void MusicShutdown( void ) return; status = MUSIC_Shutdown(); - if ( status != MUSIC_Ok ) + if (status != MUSIC_Ok) { - Error( MUSIC_ErrorString( MUSIC_ErrorCode )); + Error(MUSIC_ErrorString(MUSIC_ErrorCode)); } } @@ -153,21 +153,21 @@ void MusicUpdate(void) MUSIC_Update(); } -int USRHOOKS_GetMem(char **ptr, unsigned long size ) +int USRHOOKS_GetMem(char **ptr, unsigned long size) { *ptr = malloc(size); if (*ptr == NULL) return(USRHOOKS_Error); - return( USRHOOKS_Ok); + return(USRHOOKS_Ok); } int USRHOOKS_FreeMem(char *ptr) { free(ptr); - return( USRHOOKS_Ok); + return(USRHOOKS_Ok); } char menunum=0; @@ -210,16 +210,16 @@ void playmusic(char *fn) if (fp == -1) return; - l = kfilelength( fp ); + l = kfilelength(fp); if (l >= (signed long)sizeof(MusicPtr)) { kclose(fp); return; } - kread( fp, MusicPtr, l); - kclose( fp ); - MUSIC_PlaySong( MusicPtr, MUSIC_LoopSong ); + kread(fp, MusicPtr, l); + kclose(fp); + MUSIC_PlaySong(MusicPtr, MUSIC_LoopSong); } char loadsound(unsigned short num) @@ -238,14 +238,14 @@ char loadsound(unsigned short num) return 0; } - l = kfilelength( fp ); + l = kfilelength(fp); soundsiz[num] = l; Sound[num].lock = 200; allocache((long *)&Sound[num].ptr,l,(char *)&Sound[num].lock); - kread( fp, Sound[num].ptr , l); - kclose( fp ); + kread(fp, Sound[num].ptr , l); + kclose(fp); return 1; } @@ -257,22 +257,22 @@ int xyzsound(short num,short i,long x,long y,long z) // if(num != 358) return 0; - if ( num >= NUM_SOUNDS || + if (num >= NUM_SOUNDS || FXDevice < 0 || - ( (soundm[num]&8) && ud.lockout ) || + ((soundm[num]&8) && ud.lockout) || SoundToggle == 0 || Sound[num].num > 3 || FX_VoiceAvailable(soundpr[num]) == 0 || (ps[myconnectindex].timebeforeexit > 0 && ps[myconnectindex].timebeforeexit <= 26*3) || ps[myconnectindex].gm&MODE_MENU) return -1; - if ( soundm[num]&128 ) + if (soundm[num]&128) { sound(num); return 0; } - if ( soundm[num]&4 ) + if (soundm[num]&4) { if (VoiceToggle==0) return -1; @@ -280,7 +280,7 @@ int xyzsound(short num,short i,long x,long y,long z) return -1; for (j=0;j 0) && (soundm[j]&4) ) + if ((Sound[j].num > 0) && (soundm[j]&4)) return -1; } @@ -292,7 +292,7 @@ int xyzsound(short num,short i,long x,long y,long z) sndist = FindDistance3D((cx-x),(cy-y),(cz-z)>>4); - if ( i >= 0 && (soundm[num]&16) == 0 && PN == MUSICANDSFX && SLT < 999 && (sector[SECT].lotag&0xff) < 9 ) + if (i >= 0 && (soundm[num]&16) == 0 && PN == MUSICANDSFX && SLT < 999 && (sector[SECT].lotag&0xff) < 9) sndist = divscale14(sndist,(SHT+1)); pitchs = soundps[num]; @@ -301,15 +301,15 @@ int xyzsound(short num,short i,long x,long y,long z) if (cx) { - if ( pitchs < pitche ) - pitch = pitchs + ( rand()%cx ); - else pitch = pitche + ( rand()%cx ); + if (pitchs < pitche) + pitch = pitchs + (rand()%cx); + else pitch = pitche + (rand()%cx); } else pitch = pitchs; sndist += soundvo[num]; if (sndist < 0) sndist = 0; - if ( sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,SX,SY,SZ-(24<<8),SECT) ) + if (sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,SX,SY,SZ-(24<<8),SECT)) sndist += sndist>>5; switch (num) @@ -317,7 +317,7 @@ int xyzsound(short num,short i,long x,long y,long z) case PIPEBOMB_EXPLODE: case LASERTRIP_EXPLODE: case RPG_EXPLODE: - if (sndist > (6144) ) + if (sndist > (6144)) sndist = 6144; if (sector[ps[screenpeek].cursectnum].lotag == 2) pitch -= 1024; @@ -325,21 +325,21 @@ int xyzsound(short num,short i,long x,long y,long z) default: if (sector[ps[screenpeek].cursectnum].lotag == 2 && (soundm[num]&4) == 0) pitch = -768; - if ( sndist > 31444 && PN != MUSICANDSFX) + if (sndist > 31444 && PN != MUSICANDSFX) return -1; break; } if (ps[screenpeek].sound_pitch) pitch += ps[screenpeek].sound_pitch; - if ( Sound[num].num > 0 && PN != MUSICANDSFX ) + if (Sound[num].num > 0 && PN != MUSICANDSFX) { - if ( SoundOwner[num][0].i == i ) stopsound(num); - else if ( Sound[num].num > 1 ) stopsound(num); - else if ( badguy(&sprite[i]) && sprite[i].extra <= 0 ) stopsound(num); + if (SoundOwner[num][0].i == i) stopsound(num); + else if (Sound[num].num > 1) stopsound(num); + else if (badguy(&sprite[i]) && sprite[i].extra <= 0) stopsound(num); } - if ( PN == APLAYER && sprite[i].yvel == screenpeek ) + if (PN == APLAYER && sprite[i].yvel == screenpeek) { sndang = 0; sndist = 0; @@ -350,7 +350,7 @@ int xyzsound(short num,short i,long x,long y,long z) sndang &= 2047; } - if (Sound[num].ptr == 0) { if ( loadsound(num) == 0 ) return 0; } + if (Sound[num].ptr == 0) { if (loadsound(num) == 0) return 0; } else { if (Sound[num].lock < 200) @@ -358,12 +358,12 @@ int xyzsound(short num,short i,long x,long y,long z) else Sound[num].lock++; } - if ( soundm[num]&16 ) sndist = 0; + if (soundm[num]&16) sndist = 0; - if (sndist < ((255-LOUDESTVOLUME)<<6) ) + if (sndist < ((255-LOUDESTVOLUME)<<6)) sndist = ((255-LOUDESTVOLUME)<<6); - if ( soundm[num]&1 ) + if (soundm[num]&1) { unsigned short start; @@ -372,21 +372,21 @@ int xyzsound(short num,short i,long x,long y,long z) start = *(unsigned short *)(Sound[num].ptr + 0x14); if (*Sound[num].ptr == 'C') - voice = FX_PlayLoopedVOC( Sound[num].ptr, start, start + soundsiz[num], - pitch,sndist>>6,sndist>>6,0,soundpr[num],num); + voice = FX_PlayLoopedVOC(Sound[num].ptr, start, start + soundsiz[num], + pitch,sndist>>6,sndist>>6,0,soundpr[num],num); else - voice = FX_PlayLoopedWAV( Sound[num].ptr, start, start + soundsiz[num], - pitch,sndist>>6,sndist>>6,0,soundpr[num],num); + voice = FX_PlayLoopedWAV(Sound[num].ptr, start, start + soundsiz[num], + pitch,sndist>>6,sndist>>6,0,soundpr[num],num); } else { - if ( *Sound[num].ptr == 'C') - voice = FX_PlayVOC3D( Sound[ num ].ptr,pitch,sndang>>6,sndist>>6, soundpr[num], num ); + if (*Sound[num].ptr == 'C') + voice = FX_PlayVOC3D(Sound[ num ].ptr,pitch,sndang>>6,sndist>>6, soundpr[num], num); else - voice = FX_PlayWAV3D( Sound[ num ].ptr,pitch,sndang>>6,sndist>>6, soundpr[num], num ); + voice = FX_PlayWAV3D(Sound[ num ].ptr,pitch,sndang>>6,sndist>>6, soundpr[num], num); } - if ( voice > FX_Ok ) + if (voice > FX_Ok) { SoundOwner[num][Sound[num].num].i = i; SoundOwner[num][Sound[num].num].voice = voice; @@ -404,8 +404,8 @@ void sound(short num) if (FXDevice < 0) return; if (SoundToggle==0) return; - if (VoiceToggle==0 && (soundm[num]&4) ) return; - if ( (soundm[num]&8) && ud.lockout ) return; + if (VoiceToggle==0 && (soundm[num]&4)) return; + if ((soundm[num]&8) && ud.lockout) return; if (FX_VoiceAvailable(soundpr[num]) == 0) return; pitchs = soundps[num]; @@ -414,13 +414,13 @@ void sound(short num) if (cx) { - if ( pitchs < pitche ) - pitch = pitchs + ( rand()%cx ); - else pitch = pitche + ( rand()%cx ); + if (pitchs < pitche) + pitch = pitchs + (rand()%cx); + else pitch = pitche + (rand()%cx); } else pitch = pitchs; -if (Sound[num].ptr == 0) { if ( loadsound(num) == 0 ) return; } +if (Sound[num].ptr == 0) { if (loadsound(num) == 0) return; } else { if (Sound[num].lock < 200) @@ -428,27 +428,27 @@ if (Sound[num].ptr == 0) { if ( loadsound(num) == 0 ) return; } else Sound[num].lock++; } - if ( soundm[num]&1 ) + if (soundm[num]&1) { if (*Sound[num].ptr == 'C') { start = (long)*(unsigned short *)(Sound[num].ptr + 0x14); - voice = FX_PlayLoopedVOC( Sound[num].ptr, start, start + soundsiz[num], - pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,soundpr[num],num); + voice = FX_PlayLoopedVOC(Sound[num].ptr, start, start + soundsiz[num], + pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,soundpr[num],num); } else { start = (long)*(unsigned short *)(Sound[num].ptr + 0x14); - voice = FX_PlayLoopedWAV( Sound[num].ptr, start, start + soundsiz[num], - pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,soundpr[num],num); + voice = FX_PlayLoopedWAV(Sound[num].ptr, start, start + soundsiz[num], + pitch,LOUDESTVOLUME,LOUDESTVOLUME,LOUDESTVOLUME,soundpr[num],num); } } else { if (*Sound[num].ptr == 'C') - voice = FX_PlayVOC3D( Sound[ num ].ptr, pitch,0,255-LOUDESTVOLUME,soundpr[num], num ); + voice = FX_PlayVOC3D(Sound[ num ].ptr, pitch,0,255-LOUDESTVOLUME,soundpr[num], num); else - voice = FX_PlayWAV3D( Sound[ num ].ptr, pitch,0,255-LOUDESTVOLUME,soundpr[num], num ); + voice = FX_PlayWAV3D(Sound[ num ].ptr, pitch,0,255-LOUDESTVOLUME,soundpr[num], num); } if (voice > FX_Ok) return; @@ -523,7 +523,7 @@ void pan3dsound(void) sy = sprite[i].y; sz = sprite[i].z; - if ( PN == APLAYER && sprite[i].yvel == screenpeek) + if (PN == APLAYER && sprite[i].yvel == screenpeek) { sndang = 0; sndist = 0; @@ -533,14 +533,14 @@ void pan3dsound(void) sndang = 2048 + ca - getangle(cx-sx,cy-sy); sndang &= 2047; sndist = FindDistance3D((cx-sx),(cy-sy),(cz-sz)>>4); - if ( i >= 0 && (soundm[j]&16) == 0 && PN == MUSICANDSFX && SLT < 999 && (sector[SECT].lotag&0xff) < 9 ) + if (i >= 0 && (soundm[j]&16) == 0 && PN == MUSICANDSFX && SLT < 999 && (sector[SECT].lotag&0xff) < 9) sndist = divscale14(sndist,(SHT+1)); } sndist += soundvo[j]; if (sndist < 0) sndist = 0; - if ( sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,sx,sy,sz-(24<<8),SECT) ) + if (sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,sx,sy,sz-(24<<8),SECT)) sndist += sndist>>5; if (PN == MUSICANDSFX && SLT < 999) @@ -554,17 +554,17 @@ void pan3dsound(void) if (sndist > (6144)) sndist = (6144); break; default: - if ( sndist > 31444 && PN != MUSICANDSFX) + if (sndist > 31444 && PN != MUSICANDSFX) { stopsound(j); continue; } } - if (Sound[j].ptr == 0 && loadsound(j) == 0 ) continue; - if ( soundm[j]&16 ) sndist = 0; + if (Sound[j].ptr == 0 && loadsound(j) == 0) continue; + if (soundm[j]&16) sndist = 0; - if (sndist < ((255-LOUDESTVOLUME)<<6) ) + if (sndist < ((255-LOUDESTVOLUME)<<6)) sndist = ((255-LOUDESTVOLUME)<<6); FX_Pan3D(SoundOwner[j][k].voice,sndang>>6,sndist>>6); @@ -586,14 +586,14 @@ void testcallback(unsigned long num) if (tempk > 0) { - if ( (soundm[num]&16) == 0) + if ((soundm[num]&16) == 0) for (tempj=0;tempj= settings.bpp3d) i++; else break; } - for ( ; cd[i]; i++) { + for (i=0; cd[i];) { if (cd[i] >= settings.bpp3d) i++; else break; } + for (; cd[i]; i++) { mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1); if (mode3d < 0) continue; settings.bpp3d = cd[i]; @@ -210,19 +210,19 @@ static GtkWidget *create_window(void) GtkWidget *startbuttonlabel; GtkAccelGroup *accel_group; - accel_group = gtk_accel_group_new (); + accel_group = gtk_accel_group_new(); // Basic window - startwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (startwin), apptitle); // NOTE: use global app title - gtk_window_set_position (GTK_WINDOW (startwin), GTK_WIN_POS_CENTER); - gtk_window_set_resizable (GTK_WINDOW (startwin), FALSE); - gtk_window_set_type_hint (GTK_WINDOW (startwin), GDK_WINDOW_TYPE_HINT_DIALOG); + startwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(startwin), apptitle); // NOTE: use global app title + gtk_window_set_position(GTK_WINDOW(startwin), GTK_WIN_POS_CENTER); + gtk_window_set_resizable(GTK_WINDOW(startwin), FALSE); + gtk_window_set_type_hint(GTK_WINDOW(startwin), GDK_WINDOW_TYPE_HINT_DIALOG); // Horizontal layout of banner and controls - hlayout = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hlayout); - gtk_container_add (GTK_CONTAINER (startwin), hlayout); + hlayout = gtk_hbox_new(FALSE, 0); + gtk_widget_show(hlayout); + gtk_container_add(GTK_CONTAINER(startwin), hlayout); // Banner { @@ -230,267 +230,267 @@ static GtkWidget *create_window(void) banner = gtk_image_new_from_pixbuf(pixbuf); g_object_unref((gpointer)pixbuf); } - gtk_widget_show (banner); - gtk_box_pack_start (GTK_BOX (hlayout), banner, FALSE, FALSE, 0); - gtk_misc_set_alignment (GTK_MISC (banner), 0.5, 0); + gtk_widget_show(banner); + gtk_box_pack_start(GTK_BOX(hlayout), banner, FALSE, FALSE, 0); + gtk_misc_set_alignment(GTK_MISC(banner), 0.5, 0); // Vertical layout of tab control and start+cancel buttons - vlayout = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vlayout); - gtk_box_pack_start (GTK_BOX (hlayout), vlayout, TRUE, TRUE, 0); + vlayout = gtk_vbox_new(FALSE, 0); + gtk_widget_show(vlayout); + gtk_box_pack_start(GTK_BOX(hlayout), vlayout, TRUE, TRUE, 0); // Tab control - tabs = gtk_notebook_new (); - gtk_widget_show (tabs); - gtk_box_pack_start (GTK_BOX (vlayout), tabs, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (tabs), 4); + tabs = gtk_notebook_new(); + gtk_widget_show(tabs); + gtk_box_pack_start(GTK_BOX(vlayout), tabs, TRUE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(tabs), 4); // Vertical layout of config page main body - configvlayout = gtk_vbox_new (FALSE, 0); - gtk_widget_show (configvlayout); - gtk_container_add (GTK_CONTAINER (tabs), configvlayout); + configvlayout = gtk_vbox_new(FALSE, 0); + gtk_widget_show(configvlayout); + gtk_container_add(GTK_CONTAINER(tabs), configvlayout); // Fixed-position layout of config page controls - configlayout = gtk_fixed_new (); - gtk_widget_show (configlayout); - gtk_box_pack_start (GTK_BOX (configvlayout), configlayout, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (configlayout), 6); + configlayout = gtk_fixed_new(); + gtk_widget_show(configlayout); + gtk_box_pack_start(GTK_BOX(configvlayout), configlayout, TRUE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(configlayout), 6); // Fullscreen checkbox - fullscreencheck = gtk_check_button_new_with_mnemonic ("_Fullscreen"); - gtk_widget_show (fullscreencheck); - gtk_fixed_put (GTK_FIXED (configlayout), fullscreencheck, 248, 0); - gtk_widget_set_size_request (fullscreencheck, 85, 29); - gtk_widget_add_accelerator (fullscreencheck, "grab_focus", accel_group, - GDK_F, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen"); + gtk_widget_show(fullscreencheck); + gtk_fixed_put(GTK_FIXED(configlayout), fullscreencheck, 248, 0); + gtk_widget_set_size_request(fullscreencheck, 85, 29); + gtk_widget_add_accelerator(fullscreencheck, "grab_focus", accel_group, + GDK_F, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); // 3D video mode label - vmode3dlabel = gtk_label_new_with_mnemonic ("_Video mode:"); - gtk_widget_show (vmode3dlabel); - gtk_fixed_put (GTK_FIXED (configlayout), vmode3dlabel, 0, 0); - gtk_widget_set_size_request (vmode3dlabel, 88, 29); - gtk_misc_set_alignment (GTK_MISC (vmode3dlabel), 0, 0.5); + vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:"); + gtk_widget_show(vmode3dlabel); + gtk_fixed_put(GTK_FIXED(configlayout), vmode3dlabel, 0, 0); + gtk_widget_set_size_request(vmode3dlabel, 88, 29); + gtk_misc_set_alignment(GTK_MISC(vmode3dlabel), 0, 0.5); - inputdevlabel = gtk_label_new ("Input devices:"); - gtk_widget_show (inputdevlabel); - gtk_fixed_put (GTK_FIXED (configlayout), inputdevlabel, 0, 120); - gtk_widget_set_size_request (inputdevlabel, 88, 20); - gtk_misc_set_alignment (GTK_MISC (inputdevlabel), 0, 0.5); + inputdevlabel = gtk_label_new("Input devices:"); + gtk_widget_show(inputdevlabel); + gtk_fixed_put(GTK_FIXED(configlayout), inputdevlabel, 0, 120); + gtk_widget_set_size_request(inputdevlabel, 88, 20); + gtk_misc_set_alignment(GTK_MISC(inputdevlabel), 0, 0.5); - sounddrvlabel = gtk_label_new_with_mnemonic ("S_ound driver:"); - gtk_widget_show (sounddrvlabel); - gtk_fixed_put (GTK_FIXED (configlayout), sounddrvlabel, 0, 40); - gtk_widget_set_size_request (sounddrvlabel, 88, 29); - gtk_misc_set_alignment (GTK_MISC (sounddrvlabel), 0, 0.5); + sounddrvlabel = gtk_label_new_with_mnemonic("S_ound driver:"); + gtk_widget_show(sounddrvlabel); + gtk_fixed_put(GTK_FIXED(configlayout), sounddrvlabel, 0, 40); + gtk_widget_set_size_request(sounddrvlabel, 88, 29); + gtk_misc_set_alignment(GTK_MISC(sounddrvlabel), 0, 0.5); - sounddrvcombo = gtk_combo_box_new_text (); - gtk_widget_show (sounddrvcombo); - gtk_fixed_put (GTK_FIXED (configlayout), sounddrvcombo, 88, 40); - gtk_widget_set_size_request (sounddrvcombo, 31, 30); - gtk_widget_add_accelerator (sounddrvcombo, "grab_focus", accel_group, - GDK_O, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + sounddrvcombo = gtk_combo_box_new_text(); + gtk_widget_show(sounddrvcombo); + gtk_fixed_put(GTK_FIXED(configlayout), sounddrvcombo, 88, 40); + gtk_widget_set_size_request(sounddrvcombo, 31, 30); + gtk_widget_add_accelerator(sounddrvcombo, "grab_focus", accel_group, + GDK_O, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); - inputmousecheck = gtk_check_button_new_with_mnemonic ("Mo_use"); - gtk_widget_show (inputmousecheck); - gtk_fixed_put (GTK_FIXED (configlayout), inputmousecheck, 88, 120); - gtk_widget_set_size_request (inputmousecheck, 80, 20); - gtk_widget_add_accelerator (inputmousecheck, "grab_focus", accel_group, - GDK_U, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + inputmousecheck = gtk_check_button_new_with_mnemonic("Mo_use"); + gtk_widget_show(inputmousecheck); + gtk_fixed_put(GTK_FIXED(configlayout), inputmousecheck, 88, 120); + gtk_widget_set_size_request(inputmousecheck, 80, 20); + gtk_widget_add_accelerator(inputmousecheck, "grab_focus", accel_group, + GDK_U, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); - inputjoycheck = gtk_check_button_new_with_mnemonic ("_Joystick"); - gtk_widget_show (inputjoycheck); - gtk_fixed_put (GTK_FIXED (configlayout), inputjoycheck, 168, 120); - gtk_widget_set_size_request (inputjoycheck, 80, 20); - gtk_widget_add_accelerator (inputjoycheck, "grab_focus", accel_group, - GDK_J, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + inputjoycheck = gtk_check_button_new_with_mnemonic("_Joystick"); + gtk_widget_show(inputjoycheck); + gtk_fixed_put(GTK_FIXED(configlayout), inputjoycheck, 168, 120); + gtk_widget_set_size_request(inputjoycheck, 80, 20); + gtk_widget_add_accelerator(inputjoycheck, "grab_focus", accel_group, + GDK_J, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); // 3D video mode combo { GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); GtkCellRenderer *cell; - vmode3dcombo = gtk_combo_box_new_with_model (GTK_TREE_MODEL(list)); + vmode3dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list)); g_object_unref(G_OBJECT(list)); cell = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(vmode3dcombo), cell, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(vmode3dcombo), cell, "text", 0, NULL); } - gtk_widget_show (vmode3dcombo); - gtk_fixed_put (GTK_FIXED (configlayout), vmode3dcombo, 88, 0); - gtk_widget_set_size_request (vmode3dcombo, 150, 29); - gtk_widget_add_accelerator (vmode3dcombo, "grab_focus", accel_group, - GDK_V, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + gtk_widget_show(vmode3dcombo); + gtk_fixed_put(GTK_FIXED(configlayout), vmode3dcombo, 88, 0); + gtk_widget_set_size_request(vmode3dcombo, 150, 29); + gtk_widget_add_accelerator(vmode3dcombo, "grab_focus", accel_group, + GDK_V, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); // Always show config checkbox - alwaysshowcheck = gtk_check_button_new_with_mnemonic ("_Always show configuration on start"); - gtk_widget_show (alwaysshowcheck); - gtk_box_pack_start (GTK_BOX (configvlayout), alwaysshowcheck, FALSE, FALSE, 0); - gtk_widget_add_accelerator (alwaysshowcheck, "grab_focus", accel_group, - GDK_A, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); + alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start"); + gtk_widget_show(alwaysshowcheck); + gtk_box_pack_start(GTK_BOX(configvlayout), alwaysshowcheck, FALSE, FALSE, 0); + gtk_widget_add_accelerator(alwaysshowcheck, "grab_focus", accel_group, + GDK_A, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); // Configuration tab - configtab = gtk_label_new ("Configuration"); - gtk_widget_show (configtab); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (tabs), gtk_notebook_get_nth_page (GTK_NOTEBOOK (tabs), 0), configtab); + configtab = gtk_label_new("Configuration"); + gtk_widget_show(configtab); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 0), configtab); // Messages scrollable area - messagesscroll = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (messagesscroll); - gtk_container_add (GTK_CONTAINER (tabs), messagesscroll); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + messagesscroll = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_show(messagesscroll); + gtk_container_add(GTK_CONTAINER(tabs), messagesscroll); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); // Messages text area - messagestext = gtk_text_view_new (); - gtk_widget_show (messagestext); - gtk_container_add (GTK_CONTAINER (messagesscroll), messagestext); - gtk_text_view_set_editable (GTK_TEXT_VIEW (messagestext), FALSE); - gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (messagestext), GTK_WRAP_WORD); - gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (messagestext), FALSE); - gtk_text_view_set_left_margin (GTK_TEXT_VIEW (messagestext), 2); - gtk_text_view_set_right_margin (GTK_TEXT_VIEW (messagestext), 2); + messagestext = gtk_text_view_new(); + gtk_widget_show(messagestext); + gtk_container_add(GTK_CONTAINER(messagesscroll), messagestext); + gtk_text_view_set_editable(GTK_TEXT_VIEW(messagestext), FALSE); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(messagestext), GTK_WRAP_WORD); + gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(messagestext), FALSE); + gtk_text_view_set_left_margin(GTK_TEXT_VIEW(messagestext), 2); + gtk_text_view_set_right_margin(GTK_TEXT_VIEW(messagestext), 2); // Messages tab - messagestab = gtk_label_new ("Messages"); - gtk_widget_show (messagestab); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (tabs), gtk_notebook_get_nth_page (GTK_NOTEBOOK (tabs), 1), messagestab); + messagestab = gtk_label_new("Messages"); + gtk_widget_show(messagestab); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabs), 1), messagestab); // Dialogue box buttons layout - buttons = gtk_hbutton_box_new (); - gtk_widget_show (buttons); - gtk_box_pack_start (GTK_BOX (vlayout), buttons, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (buttons), 3); - gtk_button_box_set_layout (GTK_BUTTON_BOX (buttons), GTK_BUTTONBOX_END); + buttons = gtk_hbutton_box_new(); + gtk_widget_show(buttons); + gtk_box_pack_start(GTK_BOX(vlayout), buttons, FALSE, TRUE, 0); + gtk_container_set_border_width(GTK_CONTAINER(buttons), 3); + gtk_button_box_set_layout(GTK_BUTTON_BOX(buttons), GTK_BUTTONBOX_END); // Cancel button - cancelbutton = gtk_button_new (); - gtk_widget_show (cancelbutton); - gtk_container_add (GTK_CONTAINER (buttons), cancelbutton); - GTK_WIDGET_SET_FLAGS (cancelbutton, GTK_CAN_DEFAULT); - gtk_widget_add_accelerator (cancelbutton, "grab_focus", accel_group, - GDK_C, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - gtk_widget_add_accelerator (cancelbutton, "clicked", accel_group, - GDK_Escape, 0, - GTK_ACCEL_VISIBLE); + cancelbutton = gtk_button_new(); + gtk_widget_show(cancelbutton); + gtk_container_add(GTK_CONTAINER(buttons), cancelbutton); + GTK_WIDGET_SET_FLAGS(cancelbutton, GTK_CAN_DEFAULT); + gtk_widget_add_accelerator(cancelbutton, "grab_focus", accel_group, + GDK_C, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); + gtk_widget_add_accelerator(cancelbutton, "clicked", accel_group, + GDK_Escape, 0, + GTK_ACCEL_VISIBLE); - cancelbuttonalign = gtk_alignment_new (0.5, 0.5, 0, 0); - gtk_widget_show (cancelbuttonalign); - gtk_container_add (GTK_CONTAINER (cancelbutton), cancelbuttonalign); + cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); + gtk_widget_show(cancelbuttonalign); + gtk_container_add(GTK_CONTAINER(cancelbutton), cancelbuttonalign); - cancelbuttonlayout = gtk_hbox_new (FALSE, 2); - gtk_widget_show (cancelbuttonlayout); - gtk_container_add (GTK_CONTAINER (cancelbuttonalign), cancelbuttonlayout); + cancelbuttonlayout = gtk_hbox_new(FALSE, 2); + gtk_widget_show(cancelbuttonlayout); + gtk_container_add(GTK_CONTAINER(cancelbuttonalign), cancelbuttonlayout); - cancelbuttonicon = gtk_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_BUTTON); - gtk_widget_show (cancelbuttonicon); - gtk_box_pack_start (GTK_BOX (cancelbuttonlayout), cancelbuttonicon, FALSE, FALSE, 0); + cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(cancelbuttonicon); + gtk_box_pack_start(GTK_BOX(cancelbuttonlayout), cancelbuttonicon, FALSE, FALSE, 0); - cancelbuttonlabel = gtk_label_new_with_mnemonic ("_Cancel"); - gtk_widget_show (cancelbuttonlabel); - gtk_box_pack_start (GTK_BOX (cancelbuttonlayout), cancelbuttonlabel, FALSE, FALSE, 0); + cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel"); + gtk_widget_show(cancelbuttonlabel); + gtk_box_pack_start(GTK_BOX(cancelbuttonlayout), cancelbuttonlabel, FALSE, FALSE, 0); // Start button - startbutton = gtk_button_new (); - gtk_widget_show (startbutton); - gtk_container_add (GTK_CONTAINER (buttons), startbutton); - GTK_WIDGET_SET_FLAGS (startbutton, GTK_CAN_DEFAULT); - gtk_widget_add_accelerator (startbutton, "grab_focus", accel_group, - GDK_S, GDK_MOD1_MASK, - GTK_ACCEL_VISIBLE); - gtk_widget_add_accelerator (startbutton, "clicked", accel_group, - GDK_Return, 0, - GTK_ACCEL_VISIBLE); + startbutton = gtk_button_new(); + gtk_widget_show(startbutton); + gtk_container_add(GTK_CONTAINER(buttons), startbutton); + GTK_WIDGET_SET_FLAGS(startbutton, GTK_CAN_DEFAULT); + gtk_widget_add_accelerator(startbutton, "grab_focus", accel_group, + GDK_S, GDK_MOD1_MASK, + GTK_ACCEL_VISIBLE); + gtk_widget_add_accelerator(startbutton, "clicked", accel_group, + GDK_Return, 0, + GTK_ACCEL_VISIBLE); - startbuttonalign = gtk_alignment_new (0.5, 0.5, 0, 0); - gtk_widget_show (startbuttonalign); - gtk_container_add (GTK_CONTAINER (startbutton), startbuttonalign); + startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); + gtk_widget_show(startbuttonalign); + gtk_container_add(GTK_CONTAINER(startbutton), startbuttonalign); - startbuttonlayout = gtk_hbox_new (FALSE, 2); - gtk_widget_show (startbuttonlayout); - gtk_container_add (GTK_CONTAINER (startbuttonalign), startbuttonlayout); + startbuttonlayout = gtk_hbox_new(FALSE, 2); + gtk_widget_show(startbuttonlayout); + gtk_container_add(GTK_CONTAINER(startbuttonalign), startbuttonlayout); - startbuttonicon = gtk_image_new_from_stock ("gtk-execute", GTK_ICON_SIZE_BUTTON); - gtk_widget_show (startbuttonicon); - gtk_box_pack_start (GTK_BOX (startbuttonlayout), startbuttonicon, FALSE, FALSE, 0); + startbuttonicon = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(startbuttonicon); + gtk_box_pack_start(GTK_BOX(startbuttonlayout), startbuttonicon, FALSE, FALSE, 0); - startbuttonlabel = gtk_label_new_with_mnemonic ("_Start"); - gtk_widget_show (startbuttonlabel); - gtk_box_pack_start (GTK_BOX (startbuttonlayout), startbuttonlabel, FALSE, FALSE, 0); + startbuttonlabel = gtk_label_new_with_mnemonic("_Start"); + gtk_widget_show(startbuttonlabel); + gtk_box_pack_start(GTK_BOX(startbuttonlayout), startbuttonlabel, FALSE, FALSE, 0); // Wire up the signals - g_signal_connect ((gpointer) startwin, "delete_event", - G_CALLBACK (on_startwin_delete_event), - NULL); - g_signal_connect ((gpointer) fullscreencheck, "toggled", - G_CALLBACK (on_fullscreencheck_toggled), - NULL); - g_signal_connect ((gpointer) sounddrvcombo, "changed", - G_CALLBACK (on_sounddrvcombo_changed), - NULL); - g_signal_connect ((gpointer) inputmousecheck, "toggled", - G_CALLBACK (on_inputmousecheck_toggled), - NULL); - g_signal_connect ((gpointer) inputjoycheck, "toggled", - G_CALLBACK (on_inputjoycheck_toggled), - NULL); - g_signal_connect ((gpointer) vmode3dcombo, "changed", - G_CALLBACK (on_vmode3dcombo_changed), - NULL); - g_signal_connect ((gpointer) alwaysshowcheck, "toggled", - G_CALLBACK (on_alwaysshowcheck_toggled), - NULL); - g_signal_connect ((gpointer) cancelbutton, "clicked", - G_CALLBACK (on_cancelbutton_clicked), - NULL); - g_signal_connect ((gpointer) startbutton, "clicked", - G_CALLBACK (on_startbutton_clicked), - NULL); + g_signal_connect((gpointer) startwin, "delete_event", + G_CALLBACK(on_startwin_delete_event), + NULL); + g_signal_connect((gpointer) fullscreencheck, "toggled", + G_CALLBACK(on_fullscreencheck_toggled), + NULL); + g_signal_connect((gpointer) sounddrvcombo, "changed", + G_CALLBACK(on_sounddrvcombo_changed), + NULL); + g_signal_connect((gpointer) inputmousecheck, "toggled", + G_CALLBACK(on_inputmousecheck_toggled), + NULL); + g_signal_connect((gpointer) inputjoycheck, "toggled", + G_CALLBACK(on_inputjoycheck_toggled), + NULL); + g_signal_connect((gpointer) vmode3dcombo, "changed", + G_CALLBACK(on_vmode3dcombo_changed), + NULL); + g_signal_connect((gpointer) alwaysshowcheck, "toggled", + G_CALLBACK(on_alwaysshowcheck_toggled), + NULL); + g_signal_connect((gpointer) cancelbutton, "clicked", + G_CALLBACK(on_cancelbutton_clicked), + NULL); + g_signal_connect((gpointer) startbutton, "clicked", + G_CALLBACK(on_startbutton_clicked), + NULL); // Associate labels with their controls - gtk_label_set_mnemonic_widget (GTK_LABEL (vmode3dlabel), vmode3dcombo); - gtk_label_set_mnemonic_widget (GTK_LABEL (sounddrvlabel), sounddrvcombo); + gtk_label_set_mnemonic_widget(GTK_LABEL(vmode3dlabel), vmode3dcombo); + gtk_label_set_mnemonic_widget(GTK_LABEL(sounddrvlabel), sounddrvcombo); /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (startwin, startwin, "startwin"); - GLADE_HOOKUP_OBJECT (startwin, hlayout, "hlayout"); - GLADE_HOOKUP_OBJECT (startwin, banner, "banner"); - GLADE_HOOKUP_OBJECT (startwin, vlayout, "vlayout"); - GLADE_HOOKUP_OBJECT (startwin, tabs, "tabs"); - GLADE_HOOKUP_OBJECT (startwin, configvlayout, "configvlayout"); - GLADE_HOOKUP_OBJECT (startwin, configlayout, "configlayout"); - GLADE_HOOKUP_OBJECT (startwin, fullscreencheck, "fullscreencheck"); - GLADE_HOOKUP_OBJECT (startwin, vmode3dlabel, "vmode3dlabel"); - GLADE_HOOKUP_OBJECT (startwin, inputdevlabel, "inputdevlabel"); - GLADE_HOOKUP_OBJECT (startwin, sounddrvlabel, "sounddrvlabel"); - GLADE_HOOKUP_OBJECT (startwin, sounddrvcombo, "sounddrvcombo"); - GLADE_HOOKUP_OBJECT (startwin, inputmousecheck, "inputmousecheck"); - GLADE_HOOKUP_OBJECT (startwin, inputjoycheck, "inputjoycheck"); - GLADE_HOOKUP_OBJECT (startwin, vmode3dcombo, "vmode3dcombo"); - GLADE_HOOKUP_OBJECT (startwin, alwaysshowcheck, "alwaysshowcheck"); - GLADE_HOOKUP_OBJECT (startwin, configtab, "configtab"); - GLADE_HOOKUP_OBJECT (startwin, messagesscroll, "messagesscroll"); - GLADE_HOOKUP_OBJECT (startwin, messagestext, "messagestext"); - GLADE_HOOKUP_OBJECT (startwin, messagestab, "messagestab"); - GLADE_HOOKUP_OBJECT (startwin, buttons, "buttons"); - GLADE_HOOKUP_OBJECT (startwin, cancelbutton, "cancelbutton"); - GLADE_HOOKUP_OBJECT (startwin, cancelbuttonalign, "cancelbuttonalign"); - GLADE_HOOKUP_OBJECT (startwin, cancelbuttonlayout, "cancelbuttonlayout"); - GLADE_HOOKUP_OBJECT (startwin, cancelbuttonicon, "cancelbuttonicon"); - GLADE_HOOKUP_OBJECT (startwin, cancelbuttonlabel, "cancelbuttonlabel"); - GLADE_HOOKUP_OBJECT (startwin, startbutton, "startbutton"); - GLADE_HOOKUP_OBJECT (startwin, startbuttonalign, "startbuttonalign"); - GLADE_HOOKUP_OBJECT (startwin, startbuttonlayout, "startbuttonlayout"); - GLADE_HOOKUP_OBJECT (startwin, startbuttonicon, "startbuttonicon"); - GLADE_HOOKUP_OBJECT (startwin, startbuttonlabel, "startbuttonlabel"); + GLADE_HOOKUP_OBJECT_NO_REF(startwin, startwin, "startwin"); + GLADE_HOOKUP_OBJECT(startwin, hlayout, "hlayout"); + GLADE_HOOKUP_OBJECT(startwin, banner, "banner"); + GLADE_HOOKUP_OBJECT(startwin, vlayout, "vlayout"); + GLADE_HOOKUP_OBJECT(startwin, tabs, "tabs"); + GLADE_HOOKUP_OBJECT(startwin, configvlayout, "configvlayout"); + GLADE_HOOKUP_OBJECT(startwin, configlayout, "configlayout"); + GLADE_HOOKUP_OBJECT(startwin, fullscreencheck, "fullscreencheck"); + GLADE_HOOKUP_OBJECT(startwin, vmode3dlabel, "vmode3dlabel"); + GLADE_HOOKUP_OBJECT(startwin, inputdevlabel, "inputdevlabel"); + GLADE_HOOKUP_OBJECT(startwin, sounddrvlabel, "sounddrvlabel"); + GLADE_HOOKUP_OBJECT(startwin, sounddrvcombo, "sounddrvcombo"); + GLADE_HOOKUP_OBJECT(startwin, inputmousecheck, "inputmousecheck"); + GLADE_HOOKUP_OBJECT(startwin, inputjoycheck, "inputjoycheck"); + GLADE_HOOKUP_OBJECT(startwin, vmode3dcombo, "vmode3dcombo"); + GLADE_HOOKUP_OBJECT(startwin, alwaysshowcheck, "alwaysshowcheck"); + GLADE_HOOKUP_OBJECT(startwin, configtab, "configtab"); + GLADE_HOOKUP_OBJECT(startwin, messagesscroll, "messagesscroll"); + GLADE_HOOKUP_OBJECT(startwin, messagestext, "messagestext"); + GLADE_HOOKUP_OBJECT(startwin, messagestab, "messagestab"); + GLADE_HOOKUP_OBJECT(startwin, buttons, "buttons"); + GLADE_HOOKUP_OBJECT(startwin, cancelbutton, "cancelbutton"); + GLADE_HOOKUP_OBJECT(startwin, cancelbuttonalign, "cancelbuttonalign"); + GLADE_HOOKUP_OBJECT(startwin, cancelbuttonlayout, "cancelbuttonlayout"); + GLADE_HOOKUP_OBJECT(startwin, cancelbuttonicon, "cancelbuttonicon"); + GLADE_HOOKUP_OBJECT(startwin, cancelbuttonlabel, "cancelbuttonlabel"); + GLADE_HOOKUP_OBJECT(startwin, startbutton, "startbutton"); + GLADE_HOOKUP_OBJECT(startwin, startbuttonalign, "startbuttonalign"); + GLADE_HOOKUP_OBJECT(startwin, startbuttonlayout, "startbuttonlayout"); + GLADE_HOOKUP_OBJECT(startwin, startbuttonicon, "startbuttonicon"); + GLADE_HOOKUP_OBJECT(startwin, startbuttonlabel, "startbuttonlabel"); - gtk_window_add_accel_group (GTK_WINDOW (startwin), accel_group); + gtk_window_add_accel_group(GTK_WINDOW(startwin), accel_group); return startwin; } @@ -516,7 +516,7 @@ int startwin_close(void) { if (!gtkenabled) return 0; if (!startwin) return 1; - gtk_widget_destroy (startwin); + gtk_widget_destroy(startwin); startwin = NULL; return 0; } @@ -535,7 +535,7 @@ int startwin_puts(const char *str) textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); gtk_text_buffer_get_end_iter(textbuffer, &enditer); - for (aptr = bptr = str; *aptr != 0; ) { + for (aptr = bptr = str; *aptr != 0;) { switch (*bptr) { case '\b': if (bptr > aptr) @@ -576,7 +576,7 @@ int startwin_settitle(const char *title) { if (!gtkenabled) return 0; if (!startwin) return 1; - gtk_window_set_title (GTK_WINDOW (startwin), title); + gtk_window_set_title(GTK_WINDOW(startwin), title); return 0; } @@ -584,7 +584,7 @@ int startwin_idle(void *s) { if (!gtkenabled) return 0; //if (!startwin) return 1; - gtk_main_iteration_do (FALSE); + gtk_main_iteration_do(FALSE); return 0; } diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index 513fb7422..e59d1732b 100755 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -57,8 +57,8 @@ static void PopulateForm(int pgs) mode = checkvideomode(&settings.xdim, &settings.ydim, settings.bpp, settings.fullscreen, 1); if (mode < 0) { int cd[] = { 32, 24, 16, 15, 8, 0 }; - for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp) i++; else break; } - for ( ; cd[i]; i++) { + for (i=0; cd[i];) { if (cd[i] >= settings.bpp) i++; else break; } + for (; cd[i]; i++) { mode = checkvideomode(&settings.xdim, &settings.ydim, cd[i], settings.fullscreen, 1); if (mode < 0) continue; settings.bpp = cd[i]; diff --git a/polymer/eduke32/source/testcd.c b/polymer/eduke32/source/testcd.c index e4988e402..69250105b 100644 --- a/polymer/eduke32/source/testcd.c +++ b/polymer/eduke32/source/testcd.c @@ -36,7 +36,7 @@ Replacement cd-auth routine by Jonathon Fowler. * of it all. Because it's amusing. Who cares? */ -char testcd( char *fn, long testsiz ) +char testcd(char *fn, long testsiz) { DWORD driveletters; int i, fil, dalen; @@ -67,7 +67,7 @@ char testcd( char *fn, long testsiz ) } #else -char testcd( char *fn ) +char testcd(char *fn) { return 0; } diff --git a/polymer/eduke32/source/winbits.c b/polymer/eduke32/source/winbits.c index 73f6a2e43..c1ad5cf71 100644 --- a/polymer/eduke32/source/winbits.c +++ b/polymer/eduke32/source/winbits.c @@ -64,7 +64,7 @@ int Win_MsgBox(char *name, char *fmt, ...) // this replaces the Error() function in jmact/util_lib.c -extern void Shutdown(void ); // game.c +extern void Shutdown(void); // game.c void Error(char *error, ...) { char buf[1000];