- SW: Replace !TEST\(([\w\-\>.()\[\]]+),\s?(\w+)\) with !($1 & $2).

This commit is contained in:
Mitchell Richters 2021-12-29 16:13:28 +11:00 committed by Christoph Oelckers
parent 25f4f49e9a
commit 8df3966d08
19 changed files with 107 additions and 107 deletions

View file

@ -735,7 +735,7 @@ int DoActorStopFall(DSWActor* actor)
// don't stand on face or wall sprites - jump again
if (actor->user.lowActor && !TEST(actor->user.lowActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
if (actor->user.lowActor && !(actor->user.lowActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
{
//actor->spr.ang = NORM_ANGLE(actor->spr.ang + (RANDOM_P2(64<<8)>>8) - 32);
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024 + (RANDOM_P2(512<<8)>>8));

View file

@ -1613,7 +1613,7 @@ int InitActorReposition(DSWActor* actor)
actor->user.ActorActionFunc = DoActorReposition;
if (!TEST(actor->user.Flags, SPR_SWIMMING))
if (!(actor->user.Flags & SPR_SWIMMING))
NewStateGroup(actor, actor->user.ActorActionSet->Run);
(*actor->user.ActorActionFunc)(actor);

View file

@ -507,7 +507,7 @@ BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
if (TEST(break_info->flags, BF_OVERRIDE_BLOCK))
{
// if not blocking then skip this code
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
{
return (BREAK_INFOp)(-1);
}
@ -924,7 +924,7 @@ int AutoBreakSprite(DSWActor* breakActor, int type)
{
if (break_info->breaknum != -1)
{
if (!TEST(break_info->flags, BF_LEAVE_BREAK))
if (!(break_info->flags & BF_LEAVE_BREAK))
{
breakActor->spr.extra &= ~(SPRX_BREAKABLE);
breakActor->spr.cstat &= ~(CSTAT_SPRITE_BREAKABLE);

View file

@ -197,7 +197,7 @@ static void WeaponCheat(int player)
{
auto p = &Player[player];
if (!TEST(p->Flags, PF_TWO_UZI))
if (!(p->Flags & PF_TWO_UZI))
{
p->Flags |= PF_TWO_UZI | PF_PICKED_UP_AN_UZI;
}

View file

@ -605,7 +605,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
int bound;
// If blocking bits get unset, just die
if (!TEST(actor->spr.cstat,CSTAT_SPRITE_BLOCK) || !TEST(actor->spr.cstat,CSTAT_SPRITE_BLOCK_HITSCAN))
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK) || !(actor->spr.cstat & CSTAT_SPRITE_BLOCK_HITSCAN))
{
InitBloodSpray(actor, true, 105);
InitBloodSpray(actor, true, 105);
@ -856,7 +856,7 @@ int DoCoolgMove(DSWActor* actor)
(*actor->user.ActorActionFunc)(actor);
}
if (RANDOM_P2(1024) < 32 && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (RANDOM_P2(1024) < 32 && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
InitCoolgDrip(actor);
DoCoolgMatchPlayerZ(actor);

View file

@ -136,7 +136,7 @@ void CopySectorMatch(int match)
while (auto itActor = itsec.Next())
{
// kill anything not invisible
if (!TEST(itActor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!(itActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
if (itActor->hasU())
{

View file

@ -761,7 +761,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
if (tActor->hasU() && tActor->user.PlayerP)
{
// Shadow spell
if (!TEST(tsp->cstat, CSTAT_SPRITE_TRANSLUCENT))
if (!(tsp->cstat & CSTAT_SPRITE_TRANSLUCENT))
ShadeSprite(tsp);
// sw if its your playersprite
@ -870,7 +870,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
{
if (Player[screenpeek].actor != tActor)
{
if (!TEST(tActor->user.PlayerP->Flags, PF_VIEW_FROM_OUTSIDE))
if (!(tActor->user.PlayerP->Flags & PF_VIEW_FROM_OUTSIDE))
{
tsp->cstat &= ~(CSTAT_SPRITE_TRANSLUCENT);
}
@ -1003,7 +1003,7 @@ void CircleCamera(int *nx, int *ny, int *nz, sectortype** vsect, binangle *nang,
auto hitactor = hit.actor();
// if you hit a sprite that's not a wall sprite - try again
if (!TEST(hitactor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
if (!(hitactor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
{
auto flag_backup = hitactor->spr.cstat;
hitactor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);

View file

@ -473,7 +473,7 @@ void InventoryKeys(PLAYERp pp)
// switches you to this inventory item
pp->InventoryNum = i;
if (InventoryData[pp->InventoryNum].Init && !TEST(pp->Flags, PF_CLIMBING))
if (InventoryData[pp->InventoryNum].Init && !(pp->Flags & PF_CLIMBING))
{
if (pp->InventoryAmount[pp->InventoryNum])
{

View file

@ -456,7 +456,7 @@ JS_ProcessEchoSpot()
reverb_set = true;
}
}
if (!TEST(pp->Flags, PF_DIVING) && !reverb_set && pp->Reverb <= 0)
if (!(pp->Flags & PF_DIVING) && !reverb_set && pp->Reverb <= 0)
COVER_SetReverb(0);
}

View file

@ -715,7 +715,7 @@ int DoPhosphorus(DSWActor* actor)
// if you haven't bounced or your going slow do some puffs
if (!TEST(actor->user.Flags, SPR_BOUNCE | SPR_UNDERWATER) && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!TEST(actor->user.Flags, SPR_BOUNCE | SPR_UNDERWATER) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
auto actorNew = SpawnActor(STAT_SKIP4, PUFF, s_PhosphorExp, actor->spr.sector(),
@ -783,7 +783,7 @@ int DoChemBomb(DSWActor* actor)
{
short wall_ang;
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
PlaySound(DIGI_CHEMBOUNCE, actor, v3df_dontpan);
auto hitActor = actor->user.coll.actor();
@ -797,7 +797,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// Canister pops when first smoke starts out
if (actor->user.WaitTics == CHEMTICS && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->user.WaitTics == CHEMTICS && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
PlaySound(DIGI_GASPOP, actor, v3df_dontpan | v3df_doppler);
PlaySound(DIGI_CHEMGAS, actor, v3df_dontpan | v3df_doppler);
@ -824,7 +824,7 @@ int DoChemBomb(DSWActor* actor)
break;
}
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
PlaySound(DIGI_CHEMBOUNCE, actor, v3df_dontpan);
int wall_ang = NORM_ANGLE(getangle(wph->delta()) + 512);
@ -855,7 +855,7 @@ int DoChemBomb(DSWActor* actor)
// hit a floor
if (!(actor->user.Flags & SPR_BOUNCE))
{
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
PlaySound(DIGI_CHEMBOUNCE, actor, v3df_dontpan);
actor->user.Flags |= (SPR_BOUNCE);
ScaleSpriteVector(actor, 32000); // was 18000
@ -866,7 +866,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// Canister pops when first smoke starts out
if (actor->user.WaitTics == CHEMTICS && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->user.WaitTics == CHEMTICS && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
PlaySound(DIGI_GASPOP, actor, v3df_dontpan | v3df_doppler);
PlaySound(DIGI_CHEMGAS, actor, v3df_dontpan | v3df_doppler);
@ -901,7 +901,7 @@ int DoChemBomb(DSWActor* actor)
if (!(actor->user.Flags & SPR_BOUNCE))
{
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
PlaySound(DIGI_CHEMBOUNCE, actor, v3df_dontpan);
actor->user.Flags |= (SPR_BOUNCE);
actor->user.coll.setNone();
@ -913,7 +913,7 @@ int DoChemBomb(DSWActor* actor)
else
{
// Canister pops when first smoke starts out
if (actor->user.WaitTics == CHEMTICS && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->user.WaitTics == CHEMTICS && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
PlaySound(DIGI_GASPOP, actor, v3df_dontpan | v3df_doppler);
PlaySound(DIGI_CHEMGAS, actor, v3df_dontpan | v3df_doppler);
@ -939,7 +939,7 @@ int DoChemBomb(DSWActor* actor)
}
// if you haven't bounced or your going slow do some puffs
if (!TEST(actor->user.Flags, SPR_BOUNCE | SPR_UNDERWATER) && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (!TEST(actor->user.Flags, SPR_BOUNCE | SPR_UNDERWATER) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->spr.sector(),
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 100);
@ -1433,7 +1433,7 @@ int PlayerInitFlashBomb(PLAYERp pp)
if (dist > 16384) // Flash radius
continue;
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
continue;
if (!FAFcanseeOfs(itActor, 0, actor, - ActorSizeZ(actor)))
@ -1492,7 +1492,7 @@ int InitFlashBomb(DSWActor* actor)
if (dist > 16384) // Flash radius
continue;
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
continue;
if (!FAFcanseeOfs(itActor, 0, actor, -ActorSizeZ(actor)))
@ -1891,10 +1891,10 @@ DSWActor* DoFlagRangeTest(DSWActor* actor, int range)
if (actor == itActor)
continue;
if (!TEST(itActor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (!(itActor->spr.cstat & CSTAT_SPRITE_BLOCK))
continue;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
if (!FAFcansee(itActor, actor))
@ -1928,7 +1928,7 @@ int DoCarryFlag(DSWActor* actor)
}
// not activated yet
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
{
if ((actor->user.WaitTics -= (MISSILEMOVETICS * 2)) > 0)
return false;

View file

@ -455,7 +455,7 @@ int WeaponOperate(PLAYERp pp)
case SO_TURRET_MGUN:
// case SO_SPEED_BOAT:
if (!TEST(pp->sop->flags, SOBJ_HAS_WEAPON))
if (!(pp->sop->flags & SOBJ_HAS_WEAPON))
break;
if (pp->input.actions & SB_FIRE)
@ -1669,7 +1669,7 @@ void pUziOverlays(PANEL_SPRITEp psp, short mode)
#define UZI_CHAMBERRELOAD_XOFF 14
#define UZI_CHAMBERRELOAD_YOFF -100
if (!TEST(psp->flags, PANF_SECONDARY)) return;
if (!(psp->flags & PANF_SECONDARY)) return;
if (psp->over[0].xoff == -1)
{
@ -1971,7 +1971,7 @@ void InitWeaponUzi(PLAYERp pp)
// Is player toggling between one and two uzi's?
if (pp->CurWpn->sibling && TEST(pp->Wpn[WPN_UZI]->flags, PANF_PRIMARY) && pp->WpnUziType == 0)
{
if (!TEST(pp->CurWpn->flags, PANF_RELOAD))
if (!(pp->CurWpn->flags & PANF_RELOAD))
InitWeaponUzi2(pp->Wpn[WPN_UZI]);
}
@ -1980,7 +1980,7 @@ void InitWeaponUzi(PLAYERp pp)
{
pp->Flags &= ~(PF_PICKED_UP_AN_UZI);
if (!TEST(pp->CurWpn->flags, PANF_RELOAD))
if (!(pp->CurWpn->flags & PANF_RELOAD))
InitWeaponUzi2(pp->Wpn[WPN_UZI]);
}
return;
@ -2170,7 +2170,7 @@ void pUziHide(PANEL_SPRITEp psp)
if (pWeaponUnHideKeys(psp, psp->PresentState))
pSetState(psp->sibling, psp->sibling->PresentState);
}
else if (!TEST(psp->flags, PANF_SECONDARY))
else if (!(psp->flags & PANF_SECONDARY))
{
pWeaponUnHideKeys(psp, psp->PresentState);
}
@ -2198,7 +2198,7 @@ void pUziRest(PANEL_SPRITEp psp)
return;
}
}
else if (!TEST(psp->flags, PANF_SECONDARY))
else if (!(psp->flags & PANF_SECONDARY))
{
if (pWeaponHideKeys(psp, ps_UziHide))
return;
@ -3546,7 +3546,7 @@ void pHotheadRestTest(PANEL_SPRITEp psp)
{
if (psp->PlayerP->KeyPressBits & SB_FIRE)
{
//if (!TEST(psp->PlayerP->Flags,PF_DIVING))
//if (!(psp->PlayerP->Flags & PF_DIVING))
{
if (!WeaponOK(psp->PlayerP))
return;
@ -6126,7 +6126,7 @@ bool pWeaponUnHideKeys(PANEL_SPRITEp psp, PANEL_STATEp state)
if (psp->flags & (PANF_WEAPON_HIDE))
{
if (!TEST(psp->PlayerP->Flags, PF_WEAPON_DOWN))
if (!(psp->PlayerP->Flags & PF_WEAPON_DOWN))
{
psp->flags &= ~(PANF_WEAPON_HIDE);
pSetState(psp, state);
@ -6409,7 +6409,7 @@ void pDisplaySprites(PLAYERp pp, double smoothratio)
pal = uint8_t(psp->pal);
if (DrawBeforeView)
if (!TEST(psp->flags, PANF_DRAW_BEFORE_VIEW))
if (!(psp->flags & PANF_DRAW_BEFORE_VIEW))
continue;
if (psp->flags & (PANF_SUICIDE))
@ -6553,7 +6553,7 @@ void pDisplaySprites(PLAYERp pp, double smoothratio)
if (psp->PlayerP->Flags & (PF_VIEW_FROM_OUTSIDE))
{
if (!TEST(psp->PlayerP->Flags, PF_VIEW_OUTSIDE_WEAPON))
if (!(psp->PlayerP->Flags & PF_VIEW_OUTSIDE_WEAPON))
continue;
}
@ -6624,7 +6624,7 @@ void pDisplaySprites(PLAYERp pp, double smoothratio)
case BLOODYFIST3_SWING2:
if (TEST(flags, RS_XFLIPHUD) && x > 160)
x = 65;
else if (!TEST(flags, RS_XFLIPHUD) && x < 160)
else if (!(flags & RS_XFLIPHUD) && x < 160)
x = 345;
break;
default:

View file

@ -1170,7 +1170,7 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets
if (skip_targets != 2) // Used for spriteinfo mode
{
// don't set off mine
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
}
@ -1575,7 +1575,7 @@ void SlipSlope(PLAYERp pp)
auto sectu = pp->cursector;
if (!TEST(sectu->flags, SECTFU_SLIDE_SECTOR) || !TEST(pp->cursector->floorstat, CSTAT_SECTOR_SLOPE))
if (!(sectu->flags & SECTFU_SLIDE_SECTOR) || !(pp->cursector->floorstat & CSTAT_SECTOR_SLOPE))
return;
ang = getangle(pp->cursector->firstWall()->delta());
@ -2019,7 +2019,7 @@ void DoPlayerMove(PLAYERp pp)
pp->yvect += ((pp->input.svel*synctics*2)<<6);
friction = pp->friction;
if (!TEST(pp->Flags, PF_SWIMMING) && pp->WadeDepth)
if (!(pp->Flags & PF_SWIMMING) && pp->WadeDepth)
{
friction -= pp->WadeDepth * 100L;
}
@ -2388,7 +2388,7 @@ void DriveCrush(PLAYERp pp, int *x, int *y)
if (TEST(actor->spr.extra, SPRX_PLAYER_OR_ENEMY))
{
if (!TEST(actor->user.Flags, SPR_DEAD) && !TEST(actor->spr.extra, SPRX_BREAKABLE))
if (!(actor->user.Flags & SPR_DEAD) && !(actor->spr.extra & SPRX_BREAKABLE))
continue;
}
@ -2516,7 +2516,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
int j,k;
short startwall,endwall;
bool RectClip = !!TEST(sop->flags, SOBJ_RECT_CLIP);
bool RectClip = !!(sop->flags & SOBJ_RECT_CLIP);
if (Prediction)
return;
@ -2636,7 +2636,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
VehicleMoveHit(actor);
}
if (!TEST(sop->flags, SOBJ_NO_QUAKE))
if (!(sop->flags & SOBJ_NO_QUAKE))
{
SetPlayerQuake(pp);
}
@ -2686,7 +2686,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
VehicleMoveHit(actor);
pp->slide_xvect = -pp->xvect<<1;
pp->slide_yvect = -pp->yvect<<1;
if (!TEST(sop->flags, SOBJ_NO_QUAKE))
if (!(sop->flags & SOBJ_NO_QUAKE))
SetPlayerQuake(pp);
}
@ -3488,7 +3488,7 @@ void DoPlayerCrawl(PLAYERp pp)
return;
}
if (!TEST(pp->Flags, PF_PLAYER_MOVED))
if (!(pp->Flags & PF_PLAYER_MOVED))
{
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Crawl);
}
@ -3700,7 +3700,7 @@ bool PlayerOnLadder(PLAYERp pp)
// if the sprite blocking you hit is not a wall sprite there is something between
// you and the ladder
if (TEST(cstat, CSTAT_SPRITE_BLOCK) &&
!TEST(cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
!(cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
{
return false;
}
@ -4137,7 +4137,7 @@ void DoPlayerDivePalette(PLAYERp pp)
{
if (pp != Player + screenpeek) return;
if ((pp->DeathType == PLAYER_DEATH_DROWN || TEST((Player+screenpeek)->Flags, PF_DIVING)) && !TEST(pp->Flags, PF_DIVING_IN_LAVA))
if ((pp->DeathType == PLAYER_DEATH_DROWN || TEST((Player+screenpeek)->Flags, PF_DIVING)) && !(pp->Flags & PF_DIVING_IN_LAVA))
{
SetFadeAmt(pp,-1005,210); // Dive color , org color 208
}
@ -5831,7 +5831,7 @@ void DoPlayerDeathCheckKick(PLAYERp pp)
break;
// don't set off mine
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, plActor->spr.pos.X, plActor->spr.pos.Y, dist, a, b, c);
@ -5887,7 +5887,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
auto hitActor = plActor->user.coll.actor();
if (!TEST(hitActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
if (!(hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
break;
@ -6061,7 +6061,7 @@ void DoPlayerDeathCrumble(PLAYERp pp)
if (!TEST(pp->Flags,PF_JUMPING|PF_FALLING))
{
if (!TEST(plActor->user.Flags, SPR_BOUNCE))
if (!(plActor->user.Flags & SPR_BOUNCE))
{
DoPlayerDeathBounce(pp);
return;
@ -6113,7 +6113,7 @@ void DoPlayerDeathExplode(PLAYERp pp)
if (!TEST(pp->Flags,PF_JUMPING|PF_FALLING))
{
if (!TEST(plActor->user.Flags, SPR_BOUNCE))
if (!(plActor->user.Flags & SPR_BOUNCE))
{
DoPlayerDeathBounce(pp);
return;
@ -6491,7 +6491,7 @@ void PlayerGlobal(PLAYERp pp)
if (pp->Flags & (PF_RECOIL))
DoPlayerRecoil(pp);
if (!TEST(pp->Flags, PF_CLIP_CHEAT))
if (!(pp->Flags & PF_CLIP_CHEAT))
{
if (pp->hi_sectp && pp->lo_sectp)
{

View file

@ -196,7 +196,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
getzsofslopeptr(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, &hiz, &loz);
if (abs(hit.hitpos.Z - loz) < Z(4))
{
if (FAF_ConnectFloor(hit.hitSector) && !TEST(hit.hitSector->floorstat, CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
if (FAF_ConnectFloor(hit.hitSector) && !(hit.hitSector->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
{
updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z + Z(12), &newsector);
plax_found = true;
@ -204,7 +204,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
}
else if (labs(hit.hitpos.Z - hiz) < Z(4))
{
if (FAF_ConnectCeiling(hit.hitSector) && !TEST(hit.hitSector->floorstat, CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
if (FAF_ConnectCeiling(hit.hitSector) && !(hit.hitSector->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
{
updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z - Z(12), &newsector);
plax_found = true;
@ -301,7 +301,7 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects,
int GetZadjustment(sectortype* sect, short hitag)
{
if (sect == nullptr || !TEST(sect->extra, SECTFX_Z_ADJUST))
if (sect == nullptr || !(sect->extra & SECTFX_Z_ADJUST))
return 0;
SWStatIterator it(STAT_ST1);
@ -354,7 +354,7 @@ bool SectorZadjust(const Collision& ceilhit, int32_t* hiz, const Collision& flor
break;
}
if (!TEST(hit_sector->extra, SECTFX_Z_ADJUST))
if (!(hit_sector->extra & SECTFX_Z_ADJUST))
break;
// see if a z adjust ST1 is around
@ -404,7 +404,7 @@ bool SectorZadjust(const Collision& ceilhit, int32_t* hiz, const Collision& flor
break;
}
if (!TEST(hit_sector->extra, SECTFX_Z_ADJUST))
if (!(hit_sector->extra & SECTFX_Z_ADJUST))
break;
// see if a z adjust ST1 is around
@ -484,7 +484,7 @@ void FAFgetzrange(vec3_t pos, sectortype* sect, int32_t* hiz, Collision* ceilhit
getzrange(npos, uppersect, hiz, *ceilhit, &foo1, foo2, clipdist, clipmask);
SectorZadjust(*ceilhit, hiz, trash, nullptr);
}
else if (FAF_ConnectFloor(sect) && !TEST(sect->floorstat, CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
else if (FAF_ConnectFloor(sect) && !(sect->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
{
auto lowersect = sect;
int newz = *loz + Z(2);
@ -544,7 +544,7 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, sectortype* const sect,
getzrangepoint(x, y, newz, uppersect, hiz, ceilhit, &foo1, &foo2);
SectorZadjust(*ceilhit, hiz, trash, nullptr);
}
else if (FAF_ConnectFloor(sect) && !TEST(sect->floorstat, CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
else if (FAF_ConnectFloor(sect) && !(sect->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
{
auto lowersect = sect;
int newz = *loz + Z(2);

View file

@ -1991,7 +1991,7 @@ bool NearThings(PLAYERp pp)
if (hit.hitWall != nullptr)
{
// Near a plain old vanilla wall. Can't do anything but grunt.
if (!TEST(hit.hitWall->extra, WALLFX_DONT_STICK) && pp == Player+myconnectindex)
if (!(hit.hitWall->extra & WALLFX_DONT_STICK) && pp == Player+myconnectindex)
{
if (StdRandomRange(1000) > 970)
PlayerSound(DIGI_HITTINGWALLS, v3df_follow|v3df_dontpan,pp);
@ -2287,7 +2287,7 @@ void PlayerOperateEnv(PLAYERp pp)
{
PlayerTakeSectorDamage(pp);
}
else if ((ActorZOfBottom(pp->actor) >= sectp->floorz) && !TEST(pp->Flags, PF_DIVING))
else if ((ActorZOfBottom(pp->actor) >= sectp->floorz) && !(pp->Flags & PF_DIVING))
{
PlayerTakeSectorDamage(pp);
}
@ -2313,7 +2313,7 @@ void PlayerOperateEnv(PLAYERp pp)
if (pp->insector() && TEST(pp->cursector->extra, SECTFX_WARP_SECTOR))
{
if (!TEST(pp->Flags2, PF2_TELEPORTED))
if (!(pp->Flags2 & PF2_TELEPORTED))
{
DoPlayerWarpTeleporter(pp);
}
@ -2369,7 +2369,7 @@ void DoSineWaveFloor(void)
for (swf = &SineWaveFloor[wave][0], flags = swf->flags; swf->sectp != nullptr && swf < &SineWaveFloor[wave][SIZ(SineWaveFloor[wave])]; swf++)
{
auto sect = swf->sectp;
if (!TEST(sect->floorstat, CSTAT_SECTOR_SLOPE))
if (!(sect->floorstat & CSTAT_SECTOR_SLOPE))
continue;
if (TEST(flags, SINE_SLOPED))

View file

@ -5875,7 +5875,7 @@ void ProcessActiveVars(DSWActor* actor)
{
const int TIME_TILL_INACTIVE = (4 * 120);
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
{
// if actor has been unaware for more than a few seconds
actor->user.inactive_time += ACTORMOVETICS;
@ -6151,7 +6151,7 @@ void SpriteControl(void)
continue;
}
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
@ -6168,7 +6168,7 @@ void SpriteControl(void)
continue;
}
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
@ -6185,7 +6185,7 @@ void SpriteControl(void)
continue;
}
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
@ -6202,7 +6202,7 @@ void SpriteControl(void)
continue;
}
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);

View file

@ -135,7 +135,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
tp = t->TrackPoint;
// Skip if high tag is not ONE of the track type we are looking for
if (!TEST(t->ttflags, track_type))
if (!(t->ttflags & track_type))
continue;
// Skip if already someone on this track
@ -905,7 +905,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
so_setspriteinterpolation(sop, itActor);
if (!TEST(sop->flags, SOBJ_SPRITE_OBJ))
if (!(sop->flags & SOBJ_SPRITE_OBJ))
{
// determine if sprite is on a SO sector - set flag if
// true
@ -1519,7 +1519,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// if player has NOT moved and player is NOT riding
// set up the player for riding
if (!TEST(pp->Flags, PF_PLAYER_MOVED) && !TEST(pp->Flags, PF_PLAYER_RIDING))
if (!(pp->Flags & PF_PLAYER_MOVED) && !(pp->Flags & PF_PLAYER_RIDING))
{
pp->Flags |= (PF_PLAYER_RIDING);
@ -1686,7 +1686,7 @@ PlayerPart:
if (!actor) continue;
// if its a player sprite || NOT attached
if (!actor->hasU() || actor->user.PlayerP || !TEST(actor->user.Flags, SPR_SO_ATTACHED))
if (!actor->hasU() || actor->user.PlayerP || !(actor->user.Flags & SPR_SO_ATTACHED))
continue;
// move the player
@ -1752,7 +1752,7 @@ PlayerPart:
}
else
{
if (!TEST(sop->flags, SOBJ_DONT_ROTATE))
if (!(sop->flags & SOBJ_DONT_ROTATE))
{
// NOT part of a sector - independant of any sector
rotatepoint(sop->pmid.vec2, actor->spr.pos.vec2, delta_ang, &actor->spr.pos.vec2);
@ -1831,7 +1831,7 @@ void RefreshPoints(SECTOR_OBJECTp sop, int nx, int ny, bool dynamic)
int j;
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{
if (!TEST(sop->flags, SOBJ_SPRITE_OBJ))
if (!(sop->flags & SOBJ_SPRITE_OBJ))
{
// move all walls in sectors back to the original position
for (auto& wal : wallsofsector(*sectp))
@ -1843,7 +1843,7 @@ void RefreshPoints(SECTOR_OBJECTp sop, int nx, int ny, bool dynamic)
if (dynamic && sop->scale_type)
{
if (!TEST(wal.extra, WALLFX_DONT_SCALE))
if (!(wal.extra & WALLFX_DONT_SCALE))
{
ang = NORM_ANGLE(getangle(x - sop->xmid, y - sop->ymid));
@ -2004,7 +2004,7 @@ void CollapseSectorObject(SECTOR_OBJECTp sop, int nx, int ny)
// move all points to nx,ny
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{
if (!TEST(sop->flags, SOBJ_SPRITE_OBJ))
if (!(sop->flags & SOBJ_SPRITE_OBJ))
{
// move all walls in sectors back to the original position
for (auto& wal : wallsofsector(*sectp))
@ -2138,7 +2138,7 @@ void CallbackSOsink(ANIMp ap, void *data)
SWSectIterator it(destsect);
while (auto actor = it.Next())
{
if (!actor->hasU() || actor->user.PlayerP || !TEST(actor->user.Flags, SPR_SO_ATTACHED))
if (!actor->hasU() || actor->user.PlayerP || !(actor->user.Flags & SPR_SO_ATTACHED))
continue;
// move sprite WAY down in water
@ -2567,7 +2567,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
}
// calculate a new x and y
if (sop->vel && !TEST(sop->flags,SOBJ_MOVE_VERTICAL))
if (sop->vel && !(sop->flags & SOBJ_MOVE_VERTICAL))
{
*nx = ((sop->vel) >> 8) * locktics * bcos(sop->ang_moving) >> 14;
*ny = ((sop->vel) >> 8) * locktics * bsin(sop->ang_moving) >> 14;

View file

@ -261,7 +261,7 @@ void MoveSpritesWithSector(sectortype* sect, int z_amt, bool type)
{
bool both = false;
if ( sect->hasU())
both = !!TEST(sect->flags, SECTFU_VATOR_BOTH);
both = !!(sect->flags & SECTFU_VATOR_BOTH);
SWSectIterator it(sect);
while (auto actor = it.Next())

View file

@ -49,7 +49,7 @@ bool WarpPlaneSectorInfo(sectortype* sect, DSWActor** sp_ceiling, DSWActor** sp_
if (Prediction)
return false;
if (sect== nullptr || !TEST(sect->extra, SECTFX_WARP_SECTOR))
if (sect== nullptr || !(sect->extra & SECTFX_WARP_SECTOR))
return false;
SWStatIterator it(STAT_WARP);
@ -205,7 +205,7 @@ bool WarpSectorInfo(sectortype* sect, DSWActor** sp_warp)
{
*sp_warp = nullptr;
if (!sect || !TEST(sect->extra, SECTFX_WARP_SECTOR))
if (!sect || !(sect->extra & SECTFX_WARP_SECTOR))
return false;
SWStatIterator it(STAT_WARP);

View file

@ -2773,7 +2773,7 @@ int DoLavaErupt(DSWActor* actor)
return 0;
}
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
{
// inactive
if ((actor->user.WaitTics -= synctics) <= 0)
@ -4786,7 +4786,7 @@ int ActorChooseDeath(DSWActor* actor, DSWActor* weapActor)
actor->user.ID == WASHGIRL_R0) && weapActor->hasU() && weapActor->user.ID == NINJA_RUN_R0 && weapActor->user.PlayerP)
{
PLAYERp pp = weapActor->user.PlayerP;
if (pp && !TEST(pp->Flags, PF_DIVING)) // JBF: added null test
if (pp && !(pp->Flags & PF_DIVING)) // JBF: added null test
pp->Bloody = true;
PlaySound(DIGI_TOILETGIRLSCREAM, actor, v3df_none);
}
@ -4845,7 +4845,7 @@ int ActorChooseDeath(DSWActor* actor, DSWActor* weapActor)
else
PlayerSound(DIGI_CANBEONLYONE, v3df_follow|v3df_dontpan,pp);
}
if (!TEST(pp->Flags, PF_DIVING))
if (!(pp->Flags & PF_DIVING))
pp->Bloody = true;
}
@ -5034,7 +5034,7 @@ int ActorHealth(DSWActor* actor, short amt)
if (actor->user.Flags2 & (SPR2_DYING)) return true;
if (actor->user.Flags & (SPR_FALLING | SPR_JUMPING | SPR_CLIMBING)) return true;
if (!TEST(actor->user.Flags2, SPR2_DYING))
if (!(actor->user.Flags2 & SPR2_DYING))
{
short rnd;
@ -7019,7 +7019,7 @@ int DoDamageTest(DSWActor* actor)
if (actor == itActor)
continue;
if (!TEST(itActor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (!(itActor->spr.cstat & CSTAT_SPRITE_BLOCK))
continue;
// !JIM! Put in a cansee so that you don't take damage through walls and such
@ -7346,7 +7346,7 @@ int DoMineExpMine(DSWActor* actor)
if (itActor == actor)
continue;
if (!TEST(itActor->spr.cstat, CSTAT_SPRITE_BLOCK_HITSCAN))
if (!(itActor->spr.cstat & CSTAT_SPRITE_BLOCK_HITSCAN))
continue;
// Explosions are spherical, not planes, so let's check that way, well cylindrical at least.
@ -7410,7 +7410,7 @@ int DoStar(DSWActor* actor)
MissileHitDiveArea(actor);
if (actor->user.coll.type != kHitNone && !TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.coll.type != kHitNone && !(actor->user.Flags & SPR_UNDERWATER))
{
switch (actor->user.coll.type)
{
@ -8002,7 +8002,7 @@ int DoPlasma(DSWActor* actor)
{
auto hitActor = actor->user.coll.actor();
if (TEST(hitActor->spr.cstat, CSTAT_SPRITE_BLOCK) && !TEST(hitActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
if (TEST(hitActor->spr.cstat, CSTAT_SPRITE_BLOCK) && !(hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
{
auto hcstat = hitActor->spr.cstat;
@ -8134,14 +8134,14 @@ bool SlopeBounce(DSWActor* actor, bool *hit_wall)
// detect the ceiling and the hit_wall
if (actor->spr.pos.Z < ((hiz+loz) >> 1))
{
if (!TEST(hit_sector->ceilingstat, CSTAT_SECTOR_SLOPE))
if (!(hit_sector->ceilingstat & CSTAT_SECTOR_SLOPE))
slope = 0;
else
slope = hit_sector->ceilingheinum;
}
else
{
if (!TEST(hit_sector->floorstat, CSTAT_SECTOR_SLOPE))
if (!(hit_sector->floorstat & CSTAT_SECTOR_SLOPE))
slope = 0;
else
slope = hit_sector->floorheinum;
@ -8582,10 +8582,10 @@ int DoMineRangeTest(DSWActor* actor, int range)
if (actor == itActor)
continue;
if (!TEST(itActor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (!(itActor->spr.cstat & CSTAT_SPRITE_BLOCK))
continue;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
if (itActor->user.ID == GIRLNINJA_RUN_R0 && !ownerisplayer)
@ -8629,7 +8629,7 @@ int DoMineStuck(DSWActor* actor)
}
// not activated yet
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
{
if ((actor->user.WaitTics -= (MISSILEMOVETICS*2)) > 0)
return false;
@ -9044,7 +9044,7 @@ int DoEMPBurst(DSWActor* actor)
}
// not activated yet
if (!TEST(actor->user.Flags, SPR_ACTIVE))
if (!(actor->user.Flags & SPR_ACTIVE))
{
// activate it
actor->user.WaitTics = SEC(7);
@ -9507,7 +9507,7 @@ int DoUziBullet(DSWActor* actor)
actorNew->spr.clipdist = 128 >> 2;
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
if (!TEST(actor->user.Flags, SPR_UNDERWATER))
if (!(actor->user.Flags & SPR_UNDERWATER))
{
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, actorNew->spr.sector(), actorNew->spr.pos.X, actorNew->spr.pos.Y, actorNew->spr.pos.Z, 0, 0);
actorNew->spr.shade = -40;
@ -9603,7 +9603,7 @@ int DoElectro(DSWActor* actor)
{
auto hitActor = actor->user.coll.actor();
if (!TEST(hitActor->spr.extra, SPRX_PLAYER_OR_ENEMY) || hitActor->user.ID == SKULL_R0 || hitActor->user.ID == BETTY_R0)
if (!(hitActor->spr.extra & SPRX_PLAYER_OR_ENEMY) || hitActor->user.ID == SKULL_R0 || hitActor->user.ID == BETTY_R0)
SpawnShrap(actor, nullptr);
break;
}
@ -10774,7 +10774,7 @@ int DoNapalm(DSWActor* actor)
{
auto hitActor = actor->user.coll.actor();
if (TEST(hitActor->spr.cstat, CSTAT_SPRITE_BLOCK) && !TEST(hitActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
if (TEST(hitActor->spr.cstat, CSTAT_SPRITE_BLOCK) && !(hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
{
auto hcstat = hitActor->spr.cstat;
@ -11350,7 +11350,7 @@ int DoSerpRing(DSWActor* actor)
DSWActor* tActor = own->user.targetActor;
if (!tActor->hasU() ||
!tActor->user.PlayerP ||
!TEST(tActor->user.PlayerP->Flags, PF_DEAD))
!(tActor->user.PlayerP->Flags & PF_DEAD))
{
actor->user.targetActor = own->user.targetActor;
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.targetActor->spr.pos.X, actor->user.targetActor->spr.pos.Y, dist, a,b,c);
@ -11866,7 +11866,7 @@ int InitSwordAttack(PLAYERp pp)
if (itActor->user.PlayerP == pp)
break;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
dist = Distance(pp->pos.X, pp->pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y);
@ -12034,7 +12034,7 @@ int InitFistAttack(PLAYERp pp)
if (itActor->user.PlayerP == pp)
break;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
dist = Distance(pp->pos.X, pp->pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y);
@ -12329,7 +12329,7 @@ int InitSumoStompAttack(DSWActor* actor)
if (itActor != actor->user.targetActor)
break;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
dist = Distance(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y);
@ -13927,7 +13927,7 @@ int DoBladeDamage(DSWActor* actor)
if (itActor == actor)
break;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a, b, c);
@ -13964,7 +13964,7 @@ int DoStaticFlamesDamage(DSWActor* actor)
if (itActor == actor)
break;
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a, b, c);
@ -14007,7 +14007,7 @@ int InitCoolgBash(DSWActor* actor)
break;
// don't set off mine
if (!TEST(itActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
if (!(itActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
continue;
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a, b, c);
@ -17317,7 +17317,7 @@ int DoBubble(DSWActor* actor)
}
}
if (!TEST(actor->user.Flags, SPR_UNDERWATER))
if (!(actor->user.Flags & SPR_UNDERWATER))
{
if ((actor->user.WaitTics -= MISSILEMOVETICS) <= 0)
{