- one third of TEST().

This commit is contained in:
Christoph Oelckers 2021-12-27 19:34:06 +01:00
parent 7727597bd7
commit 61564ab96a
36 changed files with 327 additions and 327 deletions

View file

@ -495,7 +495,7 @@ void KeepActorOnFloor(DSWActor* actor)
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
return;
if (actor->user.lo_sectp && actor->user.lo_sectp->hasU())
@ -507,7 +507,7 @@ void KeepActorOnFloor(DSWActor* actor)
depth > 35 &&
actor->user.ActorActionSet && actor->user.ActorActionSet->Swim)
{
if (TEST(actor->user.Flags, SPR_SWIMMING))
if (actor->user.Flags & (SPR_SWIMMING))
{
if (actor->user.Rot != actor->user.ActorActionSet->Run && actor->user.Rot != actor->user.ActorActionSet->Swim && actor->user.Rot != actor->user.ActorActionSet->Stand)
{
@ -556,7 +556,7 @@ void KeepActorOnFloor(DSWActor* actor)
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
#if 1
if (TEST(actor->user.Flags, SPR_MOVED))
if (actor->user.Flags & (SPR_MOVED))
{
actor->user.oz = actor->spr.pos.Z = actor->user.loz;
actor->spr.backupz();
@ -630,7 +630,7 @@ int DoActorBeginJump(DSWActor* actor)
// Change sprites state to jumping
if (actor->user.ActorActionSet)
{
if (TEST(actor->user.Flags, SPR_DEAD))
if (actor->user.Flags & (SPR_DEAD))
NewStateGroup(actor, actor->user.ActorActionSet->DeathJump);
else
NewStateGroup(actor, actor->user.ActorActionSet->Jump);
@ -690,7 +690,7 @@ int DoActorBeginFall(DSWActor* actor)
// Change sprites state to falling
if (actor->user.ActorActionSet)
{
if (TEST(actor->user.Flags, SPR_DEAD))
if (actor->user.Flags & (SPR_DEAD))
{
NewStateGroup(actor, actor->user.ActorActionSet->DeathFall);
}
@ -748,7 +748,7 @@ int DoActorStopFall(DSWActor* actor)
// Change sprites state to running
if (actor->user.ActorActionSet)
{
if (TEST(actor->user.Flags, SPR_DEAD))
if (actor->user.Flags & (SPR_DEAD))
{
NewStateGroup(actor, actor->user.ActorActionSet->Dead);
PlaySound(DIGI_ACTORBODYFALL1, actor, v3df_none);
@ -774,9 +774,9 @@ int DoActorDeathMove(DSWActor* actor)
{
int nx, ny;
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else
DoActorFall(actor);

View file

@ -111,7 +111,7 @@ bool ActorFlaming(DSWActor* actor)
void DoActorSetSpeed(DSWActor* actor, uint8_t speed)
{
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
if (actor->spr.cstat & (CSTAT_SPRITE_RESTORE))
return;
ASSERT(actor->user.Attrib);
@ -289,7 +289,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
// Set initial target to Player 0
actor->user.targetActor = Player->actor;
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
TRAVERSE_CONNECT(pnum)
{
@ -311,7 +311,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
pp = &Player[pnum];
// Zombies don't target their masters!
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
if (GetOwner(actor) == pp->actor)
continue;
@ -341,7 +341,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
pp = &Player[pnum];
// Zombies don't target their masters!
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
if (GetOwner(actor) == pp->actor)
continue;
@ -493,7 +493,7 @@ ANIMATORp DoActorActionDecide(DSWActor* actor)
return action;
}
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
//CON_Message("Jumping or falling");
return action;
@ -511,7 +511,7 @@ ANIMATORp DoActorActionDecide(DSWActor* actor)
// But need the result multiple times
// !AIC KEY - If aware of player - var is changed in SpriteControl
if (TEST(actor->user.Flags, SPR_ACTIVE))
if (actor->user.Flags & (SPR_ACTIVE))
{
// Try to operate stuff
@ -551,7 +551,7 @@ ANIMATORp DoActorActionDecide(DSWActor* actor)
if (Facing(actor, actor->user.targetActor) && TEST(actor->user.Flags, SPR_ATTACKED) && ICanSee)
{
// if I'm a target - at least one missile comming at me
if (TEST(actor->user.Flags, SPR_TARGETED))
if (actor->user.Flags & (SPR_TARGETED))
{
// not going to evade, reset the target bit
actor->user.Flags &= ~(SPR_TARGETED); // as far as actor

View file

@ -974,7 +974,7 @@ bool NullActor(DSWActor* actor)
// a Null Actor is defined as an actor that has no real controlling programming attached
// check to see if attached to SO
if (TEST(actor->user.Flags, SPR_SO_ATTACHED))
if (actor->user.Flags & (SPR_SO_ATTACHED))
return true;
// does not have a STATE or FUNC to control it

View file

@ -863,7 +863,7 @@ int DoBunnyBeginJumpAttack(DSWActor* actor)
int DoBunnyMoveJump(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
int nx, ny;
@ -873,7 +873,7 @@ int DoBunnyMoveJump(DSWActor* actor)
move_actor(actor, nx, ny, 0L);
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else
DoActorFall(actor);
@ -1047,9 +1047,9 @@ int DoBunnyQuickJump(DSWActor* actor)
int NullBunny(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else
DoActorFall(actor);
@ -1059,7 +1059,7 @@ int NullBunny(DSWActor* actor)
if (!TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
KeepActorOnFloor(actor);
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
DoActorSectorDamage(actor);
@ -1230,7 +1230,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
int DoBunnyMove(DSWActor* actor)
{
// Parental lock crap
if (TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->spr.cstat & (CSTAT_SPRITE_INVISIBLE))
actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE); // Turn em' back on
// Sometimes they just won't die!
@ -1242,9 +1242,9 @@ int DoBunnyMove(DSWActor* actor)
DoScaleSprite(actor);
}
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else
DoActorFall(actor);
@ -1256,7 +1256,7 @@ int DoBunnyMove(DSWActor* actor)
DoBunnyQuickJump(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)
@ -1306,9 +1306,9 @@ int BunnySpew(DSWActor* actor)
int DoBunnyEat(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else
DoActorFall(actor);
@ -1320,7 +1320,7 @@ int DoBunnyEat(DSWActor* actor)
DoBunnyQuickJump(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
// stay on floor unless doing certain things
@ -1353,15 +1353,15 @@ int DoBunnyEat(DSWActor* actor)
int DoBunnyScrew(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else
DoActorFall(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
// stay on floor unless doing certain things

View file

@ -157,7 +157,7 @@ bool WarpCheat(cheatseq_t* c)
if (level_num > 4 || level_num < 1)
return false;
}
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return true;
DeferredStartGame(maprec, g_nextskill);

View file

@ -588,7 +588,7 @@ int NullCoolg(DSWActor* actor)
{
actor->user.ShellNum -= ACTORMOVETICS;
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
DoCoolgMatchPlayerZ(actor);
@ -751,7 +751,7 @@ int DoCoolgDeath(DSWActor* actor)
actor->spr.xrepeat = 42;
actor->spr.shade = -10;
if (TEST(actor->user.Flags, SPR_FALLING))
if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
}
@ -762,7 +762,7 @@ int DoCoolgDeath(DSWActor* actor)
DoBeginFall(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
// slide while falling
@ -846,7 +846,7 @@ int DoCoolgMove(DSWActor* actor)
actor->spr.hitag = 0;
}
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -525,7 +525,7 @@ int SpawnCoolg(DSWActor* actor)
int CooliePain(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags,SPR_CLIMBING))
@ -541,7 +541,7 @@ int CooliePain(DSWActor* actor)
int NullCoolie(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags,SPR_CLIMBING))
@ -554,7 +554,7 @@ int NullCoolie(DSWActor* actor)
int DoCoolieMove(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -770,10 +770,10 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
pp = Player + screenpeek;
if (display_mirror || TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE|PF_VIEW_FROM_CAMERA))
{
if (TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))
tsp->cstat |= (CSTAT_SPRITE_TRANSLUCENT);
if (TEST(pp->Flags, PF_CLIMBING))
if (pp->Flags & (PF_CLIMBING))
{
// move sprite forward some so he looks like he's
// climbing
@ -1473,7 +1473,7 @@ void drawscreen(PLAYERp pp, double smoothratio)
tang = bvectangbam(pp->sop_remote->xmid - tx, pp->sop_remote->ymid - ty);
}
if (TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))
{
tz -= 8448;
@ -1545,7 +1545,7 @@ void drawscreen(PLAYERp pp, double smoothratio)
// Don't show sprites tagged with 257
if (actor->spr.lotag == 257)
{
if (TEST(actor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
if (actor->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_FLOOR))
{
actor->spr.cstat &= ~(CSTAT_SPRITE_ALIGNMENT_FLOOR);
actor->spr.owner = -2;

View file

@ -402,7 +402,7 @@ int SetupEel(DSWActor* actor)
int NullEel(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
DoEelMatchPlayerZ(actor);
@ -512,7 +512,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
int DoEelDeath(DSWActor* actor)
{
int nx, ny;
if (TEST(actor->user.Flags, SPR_FALLING))
if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
}
@ -523,7 +523,7 @@ int DoEelDeath(DSWActor* actor)
DoBeginFall(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
// slide while falling
@ -555,7 +555,7 @@ int DoEelMove(DSWActor* actor)
if (SpriteOverlap(actor, actor->user.targetActor))
NewStateGroup(actor, actor->user.ActorActionSet->CloseAttack[0]);
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -742,16 +742,16 @@ int SetupGirlNinja(DSWActor* actor)
int DoGirlNinjaMove(DSWActor* actor)
{
// jumping and falling
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING) && !TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING) && !TEST(actor->user.Flags, SPR_CLIMBING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
DoActorFall(actor);
}
// sliding
if (TEST(actor->user.Flags, SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING))
DoActorSlide(actor);
// !AIC - do track or call current action function - such as DoActorMoveCloser()
@ -800,7 +800,7 @@ int NullGirlNinja(DSWActor* actor)
{
if (actor->user.WaitTics > 0) actor->user.WaitTics -= ACTORMOVETICS;
if (TEST(actor->user.Flags, SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
if (actor->user.Flags & (SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags, SPR_CLIMBING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))

View file

@ -507,7 +507,7 @@ int SetupGoro(DSWActor* actor)
int NullGoro(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
KeepActorOnFloor(actor);
@ -527,7 +527,7 @@ int DoGoroPain(DSWActor* actor)
int DoGoroMove(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -325,7 +325,7 @@ int SetupHornet(DSWActor* actor)
int NullHornet(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
DoHornetMatchPlayerZ(actor);
@ -488,7 +488,7 @@ int DoHornetDeath(DSWActor* actor)
{
int nx, ny;
if (TEST(actor->user.Flags, SPR_FALLING))
if (actor->user.Flags & (SPR_FALLING))
{
actor->user.loz = actor->user.zclip;
DoFall(actor);
@ -503,7 +503,7 @@ int DoHornetDeath(DSWActor* actor)
actor->user.zclip = actor->user.loz;
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
// slide while falling
@ -574,7 +574,7 @@ int DoHornetMove(DSWActor* actor)
if (actor->spr.hitag == TAG_SWARMSPOT && actor->spr.lotag == 1)
DoCheckSwarm(actor);
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -107,7 +107,7 @@ static void processWeapon(PLAYERp const pp)
break;
}
if (TEST(pp->WpnFlags, BIT(i)) && pp->WpnAmmo[i])
if (pp->WpnFlags & (BIT(i)) && pp->WpnAmmo[i])
{
next_weapon = i;
break;
@ -140,7 +140,7 @@ static void processWeapon(PLAYERp const pp)
if (i <= -1)
i = WPN_HEART;
if (TEST(pp->WpnFlags, BIT(i)) && pp->WpnAmmo[i])
if (pp->WpnFlags & (BIT(i)) && pp->WpnAmmo[i])
{
prev_weapon = i;
break;

View file

@ -389,8 +389,8 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
DSWActor* actor = data->actorofang;
if (!actor) continue;
if (actor->hasU() && (actor->spr.statnum != STAT_DEFAULT) &&
((TEST(actor->user.Flags, SPR_SKIP4) && (actor->spr.statnum <= STAT_SKIP4_INTERP_END)) ||
(TEST(actor->user.Flags, SPR_SKIP2) && (actor->spr.statnum <= STAT_SKIP2_INTERP_END))))
((actor->user.Flags & (SPR_SKIP4) && (actor->spr.statnum <= STAT_SKIP4_INTERP_END)) ||
(actor->user.Flags & (SPR_SKIP2) && (actor->spr.statnum <= STAT_SKIP2_INTERP_END))))
continue;
}

View file

@ -309,7 +309,7 @@ void SpawnMidSplash(DSWActor* actor)
actorNew->user.ychange = 0;
actorNew->user.zchange = 0;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -332,7 +332,7 @@ void SpawnFloorSplash(DSWActor* actor)
actorNew->user.ychange = 0;
actorNew->user.zchange = 0;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -341,7 +341,7 @@ int DoBloodSpray(DSWActor* actor)
{
int cz,fz;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
ScaleSpriteVector(actor, 50000);
@ -471,7 +471,7 @@ int DoBloodSpray(DSWActor* actor)
// hit floor
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
// underwater
@ -538,7 +538,7 @@ int DoBloodSpray(DSWActor* actor)
ScaleSpriteVector(actorNew, 20000);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -548,7 +548,7 @@ int DoBloodSpray(DSWActor* actor)
int DoPhosphorus(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
ScaleSpriteVector(actor, 50000);
@ -566,7 +566,7 @@ int DoPhosphorus(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
{
@ -675,7 +675,7 @@ int DoPhosphorus(DSWActor* actor)
// hit floor
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
// underwater
@ -743,7 +743,7 @@ int DoPhosphorus(DSWActor* actor)
ScaleSpriteVector(actorNew, 20000);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -752,7 +752,7 @@ int DoPhosphorus(DSWActor* actor)
int DoChemBomb(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
ScaleSpriteVector(actor, 50000);
@ -770,7 +770,7 @@ int DoChemBomb(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
{
@ -891,7 +891,7 @@ int DoChemBomb(DSWActor* actor)
// hit floor
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
// underwater
@ -962,7 +962,7 @@ int DoChemBomb(DSWActor* actor)
ScaleSpriteVector(actorNew, 20000);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -981,7 +981,7 @@ int DoCaltropsStick(DSWActor* actor)
int DoCaltrops(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
ScaleSpriteVector(actor, 50000);
@ -1097,7 +1097,7 @@ int DoCaltrops(DSWActor* actor)
// hit floor
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing
// underwater
@ -1167,7 +1167,7 @@ int SpawnRadiationCloud(DSWActor* actor)
return false;
}
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
return -1;
auto actorNew = SpawnActor(STAT_MISSILE, RADIATION_CLOUD, s_RadiationCloud, actor->spr.sector(),
@ -1256,7 +1256,7 @@ int PlayerInitChemBomb(PLAYERp pp)
nx, ny, nz, pp->angle.ang.asbuild(), CHEMBOMB_VELOCITY);
// don't throw it as far if crawling
if (TEST(pp->Flags, PF_CRAWLING))
if (pp->Flags & (PF_CRAWLING))
{
actorNew->spr.xvel -= (actorNew->spr.xvel >> 2);
}
@ -1276,7 +1276,7 @@ int PlayerInitChemBomb(PLAYERp pp)
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat |= (CSTAT_SPRITE_BLOCK);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
actorNew->spr.zvel = -pp->horizon.horiz.asq16() >> 9;
@ -1627,7 +1627,7 @@ int PlayerInitCaltrops(PLAYERp pp)
nx, ny, nz, pp->angle.ang.asbuild(), (CHEMBOMB_VELOCITY + RandomRange(CHEMBOMB_VELOCITY)) / 2);
// don't throw it as far if crawling
if (TEST(pp->Flags, PF_CRAWLING))
if (pp->Flags & (PF_CRAWLING))
{
actorNew->spr.xvel -= (actorNew->spr.xvel >> 2);
}
@ -1645,7 +1645,7 @@ int PlayerInitCaltrops(PLAYERp pp)
actorNew->user.Counter = 0;
// spawnedActor->spr.cstat |= (CSTAT_SPRITE_BLOCK);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// They go out at different angles

View file

@ -479,7 +479,7 @@ int SetupLava(DSWActor* actor)
int NullLava(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
KeepActorOnFloor(actor);
@ -490,7 +490,7 @@ int NullLava(DSWActor* actor)
int DoLavaMove(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -557,7 +557,7 @@ int SetupTrashCan(DSWActor* actor)
int DoTrashCan(DSWActor* actor)
{
// stay on floor unless doing certain things
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING | SPR_CLIMBING))
@ -572,7 +572,7 @@ int DoTrashCan(DSWActor* actor)
int TrashCanPain(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags,SPR_CLIMBING))

View file

@ -1847,7 +1847,7 @@ int SetupNinja(DSWActor* actor)
actor->spr.hitag = 9998;
if (pic == NINJA_CRAWL_R0)
{
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
{
actor->user.Attrib = &NinjaAttrib;
actor->user.ActorActionSet = &NinjaActionSet;
@ -1872,7 +1872,7 @@ int SetupNinja(DSWActor* actor)
actor->spr.pal = actor->user.spal = PALETTE_PLAYER3;
if (pic == NINJA_CRAWL_R0)
{
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
{
actor->user.Attrib = &NinjaAttrib;
actor->user.ActorActionSet = &NinjaActionSet;
@ -1991,7 +1991,7 @@ int DoNinjaGrabThroat(DSWActor* actor)
int DoNinjaMove(DSWActor* actor)
{
if (TEST(actor->user.Flags2, SPR2_DYING))
if (actor->user.Flags2 & (SPR2_DYING))
{
if (sw_ninjahack)
NewStateGroup(actor, sg_NinjaHariKari);
@ -2001,16 +2001,16 @@ int DoNinjaMove(DSWActor* actor)
}
// jumping and falling
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING) && !TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING) && !TEST(actor->user.Flags, SPR_CLIMBING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
DoActorFall(actor);
}
// sliding
if (TEST(actor->user.Flags, SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING))
DoActorSlide(actor);
// !AIC - do track or call current action function - such as DoActorMoveCloser()
@ -2066,7 +2066,7 @@ int NullNinja(DSWActor* actor)
{
if (actor->user.WaitTics > 0) actor->user.WaitTics -= ACTORMOVETICS;
if (TEST(actor->user.Flags, SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
if (actor->user.Flags & (SPR_SLIDING) && !TEST(actor->user.Flags, SPR_CLIMBING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags, SPR_CLIMBING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
@ -2082,7 +2082,7 @@ int DoNinjaPain(DSWActor* actor)
{
NullNinja(actor);
if (TEST(actor->user.Flags2, SPR2_DYING))
if (actor->user.Flags2 & (SPR2_DYING))
{
if (sw_ninjahack)
NewStateGroup(actor, sg_NinjaHariKari);
@ -2149,7 +2149,7 @@ void PlayerLevelReset(PLAYERp pp)
return;
}
if (TEST(pp->Flags, PF_DIVING))
if (pp->Flags & (PF_DIVING))
DoPlayerStopDiveNoWarp(pp);
COVER_SetReverb(0); // Turn off any echoing that may have been going before
@ -2182,7 +2182,7 @@ void PlayerDeathReset(PLAYERp pp)
{
DSWActor* actor = pp->actor;
if (TEST(pp->Flags, PF_DIVING))
if (pp->Flags & (PF_DIVING))
DoPlayerStopDiveNoWarp(pp);
COVER_SetReverb(0); // Turn off any echoing that may have been going before

View file

@ -100,7 +100,7 @@ void GameInterface::ToggleThirdPerson()
{
if (gamestate != GS_LEVEL) return;
auto pp = &Player[myconnectindex];
if (TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))
{
pp->Flags &= ~(PF_VIEW_FROM_OUTSIDE);
}

View file

@ -233,7 +233,7 @@ void PlayerUpdateHealth(PLAYERp pp, short value)
return;
}
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
if (value < 0)
@ -519,7 +519,7 @@ int WeaponOperate(PLAYERp pp)
case WPN_UZI:
if (plActor->user.WeaponNum == WPN_UZI)
{
if (TEST(pp->Flags, PF_TWO_UZI))
if (pp->Flags & (PF_TWO_UZI))
{
pp->WpnUziType++;
PlaySound(DIGI_UZI_UP, pp, v3df_follow);
@ -698,7 +698,7 @@ bool WeaponOK(PLAYERp pp)
}
// if you have the weapon and the ammo is greater than 0
if (TEST(pp->WpnFlags, BIT(FindWeaponNum)) && pp->WpnAmmo[FindWeaponNum] >= min_ammo)
if (pp->WpnFlags & (BIT(FindWeaponNum)) && pp->WpnAmmo[FindWeaponNum] >= min_ammo)
break;
wpn_ndx++;
@ -1982,7 +1982,7 @@ void InitWeaponUzi(PLAYERp pp)
}
// if actually picked an uzi up and don't currently have double uzi
if (TEST(pp->Flags, PF_PICKED_UP_AN_UZI) && !TEST(pp->Wpn[WPN_UZI]->flags, PANF_PRIMARY))
if (pp->Flags & (PF_PICKED_UP_AN_UZI) && !TEST(pp->Wpn[WPN_UZI]->flags, PANF_PRIMARY))
{
pp->Flags &= ~(PF_PICKED_UP_AN_UZI);
@ -2011,7 +2011,7 @@ void InitWeaponUzi(PLAYERp pp)
// power up
// NOTE: PRIMARY is ONLY set when there is a powerup
if (TEST(pp->Flags, PF_TWO_UZI))
if (pp->Flags & (PF_TWO_UZI))
{
InitWeaponUzi2(psp);
}
@ -2284,7 +2284,7 @@ void pUziFire(PANEL_SPRITEp psp)
// If its the second Uzi, give the shell back only if it's a reload count to keep #'s even
if (TEST(psp->flags, PANF_SECONDARY))
{
if (TEST(pp->Flags, PF_TWO_UZI) && psp->sibling)
if (pp->Flags & (PF_TWO_UZI) && psp->sibling)
{
if ((pp->WpnAmmo[WPN_UZI] % 100) == 0)
pp->WpnAmmo[WPN_UZI]++;
@ -2300,7 +2300,7 @@ void pUziFire(PANEL_SPRITEp psp)
return;
// Reload if done with clip
if (TEST(pp->Flags, PF_TWO_UZI) && psp->sibling)
if (pp->Flags & (PF_TWO_UZI) && psp->sibling)
{
if ((pp->WpnAmmo[WPN_UZI] % 100) == 0)
pUziStartReload(psp);

View file

@ -1083,7 +1083,7 @@ int DoPlayerSpriteReset(DSWActor* actor)
NewStateGroup(pp->actor, actor->user.ActorActionSet->Crawl);
else
{
if (TEST(pp->Flags, PF_PLAYER_MOVED))
if (pp->Flags & (PF_PLAYER_MOVED))
NewStateGroup(pp->actor, actor->user.ActorActionSet->Run);
else
NewStateGroup(pp->actor, actor->user.ActorActionSet->Stand);
@ -1744,7 +1744,7 @@ void UpdatePlayerSprite(PLAYERp pp)
actor->spr.pos.Y = pp->pos.Y;
// there are multiple death functions
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
{
ChangeActorSect(pp->actor, pp->cursector);
actor->spr.ang = pp->angle.ang.asbuild();
@ -1906,7 +1906,7 @@ void DoPlayerSlide(PLAYERp pp)
PlayerUpdateHealth(pp, -actor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
return;
@ -1923,7 +1923,7 @@ void DoPlayerSlide(PLAYERp pp)
PlayerUpdateHealth(pp, -actor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
return;
@ -2027,13 +2027,13 @@ void DoPlayerMove(PLAYERp pp)
pp->xvect = MulScale(pp->xvect, friction, 16);
pp->yvect = MulScale(pp->yvect, friction, 16);
if (TEST(pp->Flags, PF_FLYING))
if (pp->Flags & (PF_FLYING))
{
// do a bit of weighted averaging
pp->xvect = (pp->xvect + (pp->oxvect*1))/2;
pp->yvect = (pp->yvect + (pp->oyvect*1))/2;
}
else if (TEST(pp->Flags, PF_DIVING))
else if (pp->Flags & (PF_DIVING))
{
// do a bit of weighted averaging
pp->xvect = (pp->xvect + (pp->oxvect*2))/3;
@ -2045,7 +2045,7 @@ void DoPlayerMove(PLAYERp pp)
actor->spr.xvel = FindDistance2D(pp->xvect,pp->yvect)>>14;
if (TEST(pp->Flags, PF_CLIP_CHEAT))
if (pp->Flags & (PF_CLIP_CHEAT))
{
auto sect = pp->cursector;
if (interpolate_ride)
@ -2070,7 +2070,7 @@ void DoPlayerMove(PLAYERp pp)
PlayerUpdateHealth(pp, -actor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
}
@ -2099,7 +2099,7 @@ void DoPlayerMove(PLAYERp pp)
PlayerUpdateHealth(pp, -actor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
}
@ -2134,7 +2134,7 @@ void DoPlayerMove(PLAYERp pp)
if (pp->insector() && TEST(pp->cursector->extra, SECTFX_DYNAMIC_AREA))
{
if (TEST(pp->Flags, PF_FLYING|PF_JUMPING|PF_FALLING))
if (pp->Flags & (PF_FLYING|PF_JUMPING|PF_FALLING))
{
if (pp->pos.Z > pp->loz)
pp->pos.Z = pp->loz - PLAYER_HEIGHT;
@ -2142,7 +2142,7 @@ void DoPlayerMove(PLAYERp pp)
if (pp->pos.Z < pp->hiz)
pp->pos.Z = pp->hiz + PLAYER_HEIGHT;
}
else if (TEST(pp->Flags, PF_SWIMMING|PF_DIVING))
else if (pp->Flags & (PF_SWIMMING|PF_DIVING))
{
if (pp->pos.Z > pp->loz)
pp->pos.Z = pp->loz - PLAYER_SWIM_HEIGHT;
@ -2392,7 +2392,7 @@ void DriveCrush(PLAYERp pp, int *x, int *y)
continue;
}
if (TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->spr.cstat & (CSTAT_SPRITE_INVISIBLE))
continue;
if (actor->spr.statnum > STAT_DONT_DRAW)
@ -3071,7 +3071,7 @@ void DoPlayerFall(PLAYERp pp)
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
@ -4365,7 +4365,7 @@ void DoPlayerDive(PLAYERp pp)
PlayerSound(DIGI_WANGDROWNING, v3df_dontpan|v3df_follow, pp);
PlayerUpdateHealth(pp, -3 -(RandomRange(7<<8)>>8));
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
}
@ -4378,7 +4378,7 @@ void DoPlayerDive(PLAYERp pp)
// while diving in lava
// every DamageTics time take some damage
if (TEST(pp->Flags, PF_DIVING_IN_LAVA))
if (pp->Flags & (PF_DIVING_IN_LAVA))
{
if ((plActor->user.DamageTics -= synctics) < 0)
{
@ -4558,7 +4558,7 @@ void DoPlayerCurrent(PLAYERp pp)
PlayerUpdateHealth(pp, -plActor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
return;
@ -4577,7 +4577,7 @@ void DoPlayerCurrent(PLAYERp pp)
PlayerUpdateHealth(pp, -plActor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
return;
@ -4731,7 +4731,7 @@ void DoPlayerWade(PLAYERp pp)
// Move about
DoPlayerMove(pp);
if (TEST(pp->Flags, PF_PLAYER_MOVED))
if (pp->Flags & (PF_PLAYER_MOVED))
{
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
@ -5444,7 +5444,7 @@ void DoPlayerBeginDie(PLAYERp pp)
DoPlayerStopOperate(pp);
// if diving force death to drown type
if (TEST(pp->Flags, PF_DIVING))
if (pp->Flags & (PF_DIVING))
pp->DeathType = PLAYER_DEATH_DROWN;
pp->Flags &= ~(PF_JUMPING|PF_FALLING|PF_DIVING|PF_FLYING|PF_CLIMBING|PF_CRAWLING|PF_LOCK_CRAWL);
@ -5697,7 +5697,7 @@ void DoPlayerDeathFollowKiller(PLAYERp pp)
//DoPlayerDeathTilt(pp, pp->tilt_dest, 4 * synctics);
// allow turning
if (TEST(pp->Flags, PF_DEAD_HEAD|PF_HEAD_CONTROL))
if (pp->Flags & (PF_DEAD_HEAD|PF_HEAD_CONTROL))
{
if (!SyncInput())
{
@ -6169,7 +6169,7 @@ void DoPlayerBeginRun(PLAYERp pp)
ASSERT(plActor->user.ActorActionSet->Run);
if (TEST(pp->Flags, PF_PLAYER_MOVED))
if (pp->Flags & (PF_PLAYER_MOVED))
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
else
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
@ -6282,7 +6282,7 @@ void DoPlayerRun(PLAYERp pp)
if (plActor->user.Rot != sg_PlayerNinjaSword && plActor->user.Rot != sg_PlayerNinjaPunch)
{
if (TEST(pp->Flags, PF_PLAYER_MOVED))
if (pp->Flags & (PF_PLAYER_MOVED))
{
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
@ -6488,7 +6488,7 @@ void PlayerGlobal(PLAYERp pp)
PlayerTimers(pp);
if (TEST(pp->Flags, PF_RECOIL))
if (pp->Flags & (PF_RECOIL))
DoPlayerRecoil(pp);
if (!TEST(pp->Flags, PF_CLIP_CHEAT))
@ -6509,7 +6509,7 @@ void PlayerGlobal(PLAYERp pp)
PlayerUpdateHealth(pp, -pp->actor->user.Health); // Make sure he dies!
PlayerCheckDeath(pp, nullptr);
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
return;
}
}
@ -6835,7 +6835,7 @@ void PlayerSpawnPosition(PLAYERp pp)
case MULTI_GAME_AI_BOTS:
{
// start from random position after death
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
{
pos_num = SearchSpawnPosition(pp);
}

View file

@ -1014,9 +1014,9 @@ int DoRipperMoveHang(DSWActor* actor)
int DoRipperHangJF(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoJump(actor);
else
DoFall(actor);
@ -1076,9 +1076,9 @@ int DoRipperBeginJumpAttack(DSWActor* actor)
int DoRipperMoveJump(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoJump(actor);
else
DoFall(actor);
@ -1122,7 +1122,7 @@ int DoRipperQuickJump(DSWActor* actor)
int NullRipper(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
DoActorSectorDamage(actor);
@ -1210,9 +1210,9 @@ int DoRipperMove(DSWActor* actor)
DoScaleSprite(actor);
}
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoJump(actor);
else
DoFall(actor);
@ -1227,7 +1227,7 @@ int DoRipperMove(DSWActor* actor)
KeepActorOnFloor(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -1034,9 +1034,9 @@ int DoRipper2MoveHang(DSWActor* actor)
int DoRipper2HangJF(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoJump(actor);
else
DoFall(actor);
@ -1098,9 +1098,9 @@ int DoRipper2BeginJumpAttack(DSWActor* actor)
int DoRipper2MoveJump(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoJump(actor);
else
DoFall(actor);
@ -1145,7 +1145,7 @@ int DoRipper2QuickJump(DSWActor* actor)
int NullRipper2(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
DoActorSectorDamage(actor);
@ -1238,9 +1238,9 @@ int DoRipper2Move(DSWActor* actor)
DoScaleSprite(actor);
}
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoJump(actor);
else
DoFall(actor);
@ -1255,7 +1255,7 @@ int DoRipper2Move(DSWActor* actor)
KeepActorOnFloor(actor);
}
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -175,7 +175,7 @@ void DoRotatorMatch(PLAYERp pp, short match, bool manual)
}
}
if (TEST(actor->user.Flags, SPR_ACTIVE))
if (actor->user.Flags & (SPR_ACTIVE))
{
ReverseRotator(actor);
continue;
@ -198,7 +198,7 @@ bool TestRotatorMatchActive(short match)
if (TEST_BOOL6(actor))
continue;
if (TEST(actor->user.Flags, SPR_ACTIVE) || actor->user.Tics)
if (actor->user.Flags & (SPR_ACTIVE) || actor->user.Tics)
return true;
}
}

View file

@ -1836,7 +1836,7 @@ void OperateTripTrigger(PLAYERp pp)
SWStatIterator it(STAT_ENEMY);
while (auto actor = it.Next())
{
if (TEST(actor->user.Flags, SPR_WAIT_FOR_TRIGGER))
if (actor->user.Flags & (SPR_WAIT_FOR_TRIGGER))
{
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < dist)
{
@ -2143,7 +2143,7 @@ int DoPlayerGrabStar(PLAYERp pp)
PlaySound(DIGI_ITEM, StarQueue[i], v3df_none);
KillActor(StarQueue[i]);
StarQueue[i] = nullptr;
if (TEST(pp->WpnFlags, BIT(WPN_STAR)))
if (pp->WpnFlags & (BIT(WPN_STAR)))
return true;
pp->WpnFlags |= (BIT(WPN_STAR));
InitWeaponStar(pp);

View file

@ -745,7 +745,7 @@ int SetupSerp(DSWActor* actor)
int NullSerp(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
KeepActorOnFloor(actor);
@ -756,7 +756,7 @@ int NullSerp(DSWActor* actor)
int DoSerpMove(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -571,7 +571,7 @@ int DoSkelTermTeleport(DSWActor* actor)
int NullSkel(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
KeepActorOnFloor(actor);
@ -592,7 +592,7 @@ int DoSkelPain(DSWActor* actor)
int DoSkelMove(DSWActor* actor)
{
if (TEST(actor->user.Flags,SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
if (actor->user.track >= 0)

View file

@ -349,11 +349,11 @@ int DoSkullJump(DSWActor* actor)
else
actor->spr.ang = NORM_ANGLE(actor->spr.ang + (64 * ACTORMOVETICS));
if (TEST(actor->user.Flags,SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
}
else if (TEST(actor->user.Flags,SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
@ -728,11 +728,11 @@ int DoBettyJump(DSWActor* actor)
else
actor->spr.ang = NORM_ANGLE(actor->spr.ang + (64 * ACTORMOVETICS));
if (TEST(actor->user.Flags,SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
}
else if (TEST(actor->user.Flags,SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);

View file

@ -167,7 +167,7 @@ void DoSlidorMatch(PLAYERp pp, short match, bool manual)
}
}
if (TEST(actor->user.Flags, SPR_ACTIVE))
if (actor->user.Flags & (SPR_ACTIVE))
{
ReverseSlidor(actor);
continue;
@ -190,7 +190,7 @@ bool TestSlidorMatchActive(short match)
if (TEST_BOOL6(actor))
continue;
if (TEST(actor->user.Flags, SPR_ACTIVE) || actor->user.Tics)
if (actor->user.Flags & (SPR_ACTIVE) || actor->user.Tics)
return true;
}
}

View file

@ -800,7 +800,7 @@ int _PlayerSound(int num, PLAYERp pp)
if (num < 0 || num >= DIGI_MAX || !soundEngine->isValidSoundId(num) || !SoundEnabled())
return 0;
if (TEST(pp->Flags, PF_DEAD)) return 0; // You're dead, no talking!
if (pp->Flags & (PF_DEAD)) return 0; // You're dead, no talking!
// If this is a player voice and he's already yacking, forget it.
vp = &voc[num];

View file

@ -88,7 +88,7 @@ void SetSpikeActive(DSWActor* actor)
{
SECTORp sectp = actor->spr.sector();
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
StartInterpolation(actor->spr.sector(), Interp_Sect_Ceilingheinum);
else
StartInterpolation(actor->spr.sector(), Interp_Sect_Floorheinum);
@ -114,7 +114,7 @@ void SetSpikeInactive(DSWActor* actor)
{
SECTORp sectp = actor->spr.sector();
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
StopInterpolation(sectp, Interp_Sect_Ceilingheinum);
else
StopInterpolation(sectp, Interp_Sect_Floorheinum);
@ -182,7 +182,7 @@ bool TestSpikeMatchActive(short match)
if (TEST_BOOL6(actor))
continue;
if (TEST(actor->user.Flags, SPR_ACTIVE) || actor->user.Tics)
if (actor->user.Flags & (SPR_ACTIVE) || actor->user.Tics)
return true;
}
}
@ -231,14 +231,14 @@ void SpikeAlign(DSWActor* actor)
// either work on single sector or all tagged in SOBJ
if ((int8_t)SP_TAG7(actor) < 0)
{
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
alignceilslope(actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
else
alignflorslope(actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
}
else
{
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);
else
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->spr.pos.X, actor->spr.pos.Y, actor->user.zclip);

View file

@ -630,7 +630,7 @@ void KillActor(DSWActor* actor)
int pnum;
// doing a MissileSetPos - don't allow killing
if (TEST(actor->user.Flags, SPR_SET_POS_DONT_KILL))
if (actor->user.Flags & (SPR_SET_POS_DONT_KILL))
return;
// for attached sprites that are getable make sure they don't have
@ -639,7 +639,7 @@ void KillActor(DSWActor* actor)
AnimDelete(ANIM_Spritez, 0, actor);
// adjust sprites attached to sector objects
if (TEST(actor->user.Flags, SPR_SO_ATTACHED))
if (actor->user.Flags & (SPR_SO_ATTACHED))
{
SECTOR_OBJECTp sop;
int sn, FoundSpriteNdx = -1;
@ -717,7 +717,7 @@ void KillActor(DSWActor* actor)
}
// much faster
if (TEST(actor->user.Flags2, SPR2_CHILDREN))
if (actor->user.Flags2 & (SPR2_CHILDREN))
{
// check for children and alert them that the Owner is dead
// don't bother th check if you've never had children
@ -1571,12 +1571,12 @@ void SpriteSetup(void)
}
// CSTAT_SPIN is insupported - get rid of it
if (TEST(actor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_SLAB)
if ((actor->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK)) == CSTAT_SPRITE_ALIGNMENT_SLAB)
actor->spr.cstat &= ~(CSTAT_SPRITE_ALIGNMENT_SLAB);
// if BLOCK is set set BLOCK_HITSCAN
// Hope this doesn't screw up anything
if (TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
if (actor->spr.cstat & (CSTAT_SPRITE_BLOCK))
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK_HITSCAN);
////////////////////////////////////////////
@ -1657,7 +1657,7 @@ void SpriteSetup(void)
short track_num;
// skip this sprite, just for numbering walls/sectors
if (TEST(actor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
if (actor->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_WALL))
continue;
track_num = actor->spr.picnum - TRACK_SPRITE + 0;
@ -2014,7 +2014,7 @@ void SpriteSetup(void)
time = SP_TAG9(actor);
start_on = !!TEST_BOOL1(actor);
floor_vator = true;
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
floor_vator = false;
actor->user.jump_speed = actor->user.vel_tgt = speed;
@ -2218,7 +2218,7 @@ void SpriteSetup(void)
time = SP_TAG9(actor);
start_on = !!TEST_BOOL1(actor);
floor_vator = true;
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
floor_vator = false;
actor->user.jump_speed = actor->user.vel_tgt = speed;
@ -4623,7 +4623,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
int cliptype = CLIPMASK_ACTOR;
if (TEST(actor->user.Flags, SPR_NO_SCAREDZ))
if (actor->user.Flags & (SPR_NO_SCAREDZ))
{
// For COOLG & HORNETS
// set to actual z before you move
@ -4802,7 +4802,7 @@ int KillGet(DSWActor* actor)
case MULTI_GAME_COMMBAT:
case MULTI_GAME_AI_BOTS:
if (TEST(actor->user.Flags2, SPR2_NEVER_RESPAWN))
if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
{
KillActor(actor);
break;
@ -4838,7 +4838,7 @@ int KillGetAmmo(DSWActor* actor)
case MULTI_GAME_COMMBAT:
case MULTI_GAME_AI_BOTS:
if (TEST(actor->user.Flags2, SPR2_NEVER_RESPAWN))
if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
{
KillActor(actor);
break;
@ -4881,7 +4881,7 @@ int KillGetWeapon(DSWActor* actor)
// don't kill weapons in coop
// unless told too :)
if (TEST(actor->user.Flags2, SPR2_NEVER_RESPAWN))
if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
{
KillActor(actor);
break;
@ -4891,7 +4891,7 @@ int KillGetWeapon(DSWActor* actor)
case MULTI_GAME_COMMBAT:
case MULTI_GAME_AI_BOTS:
if (TEST(actor->user.Flags2, SPR2_NEVER_RESPAWN))
if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
{
KillActor(actor);
break;
@ -4954,7 +4954,7 @@ bool CanGetWeapon(PLAYERp pp, DSWActor* actor, int WPN)
return true;
case MULTI_GAME_COOPERATIVE:
if (TEST(actor->user.Flags2, SPR2_NEVER_RESPAWN))
if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
return true;
if (TEST(pp->WpnGotOnceFlags, BIT(WPN)))
@ -4965,7 +4965,7 @@ bool CanGetWeapon(PLAYERp pp, DSWActor* actor, int WPN)
case MULTI_GAME_COMMBAT:
case MULTI_GAME_AI_BOTS:
if (TEST(actor->user.Flags2, SPR2_NEVER_RESPAWN))
if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
return true;
// No Respawn - can't get a weapon again if you already got it
@ -5010,7 +5010,7 @@ int DoGet(DSWActor* actor)
// Invisiblility is only used for DeathMatch type games
// Sprites stays invisible for a period of time and is un-gettable
// then "Re-Spawns" by becomming visible. Its never actually killed.
if (TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->spr.cstat & (CSTAT_SPRITE_INVISIBLE))
{
actor->user.WaitTics -= ACTORMOVETICS * 2;
if (actor->user.WaitTics <= 0)
@ -5037,7 +5037,7 @@ int DoGet(DSWActor* actor)
pp = &Player[pnum];
DSWActor* plActor = pp->actor;
if (TEST(pp->Flags, PF_DEAD))
if (pp->Flags & (PF_DEAD))
continue;
DISTANCE(pp->pos.X, pp->pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a,b,c);
@ -5367,7 +5367,7 @@ KeyMain:
if (pp == Player+myconnectindex)
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_STAR)))
if (pp->WpnFlags & (BIT(WPN_STAR)))
break;
pp->WpnFlags |= (BIT(WPN_STAR));
@ -5395,7 +5395,7 @@ KeyMain:
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
ChoosePlayerGetSound(pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_MINE)))
if (pp->WpnFlags & (BIT(WPN_MINE)))
break;
pp->WpnFlags |= (BIT(WPN_MINE));
@ -5414,7 +5414,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_UZI));
if (TEST(pp->Flags, PF_TWO_UZI) && pp->WpnAmmo[WPN_UZI] >= DamageData[WPN_UZI].max_ammo)
if (pp->Flags & (PF_TWO_UZI) && pp->WpnAmmo[WPN_UZI] >= DamageData[WPN_UZI].max_ammo)
break;
//sprintf(ds,"UZI Submachine Gun");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNUZI));
@ -5425,11 +5425,11 @@ KeyMain:
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_UZI)) && TEST(pp->Flags, PF_TWO_UZI))
if (pp->WpnFlags & (BIT(WPN_UZI)) && TEST(pp->Flags, PF_TWO_UZI))
break;
// flag to help with double uzi powerup - simpler but kludgy
pp->Flags |= (PF_PICKED_UP_AN_UZI);
if (TEST(pp->WpnFlags, BIT(WPN_UZI)))
if (pp->WpnFlags & (BIT(WPN_UZI)))
{
pp->Flags |= (PF_TWO_UZI);
pp->WpnUziType = 0; // Let it come up
@ -5470,7 +5470,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_MICRO));
if (TEST(pp->WpnFlags, BIT(WPN_MICRO)) && pp->WpnAmmo[WPN_MICRO] >= DamageData[WPN_MICRO].max_ammo)
if (pp->WpnFlags & (BIT(WPN_MICRO)) && pp->WpnAmmo[WPN_MICRO] >= DamageData[WPN_MICRO].max_ammo)
break;
//sprintf(ds,"Missile Launcher");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNLAUNCH));
@ -5481,7 +5481,7 @@ KeyMain:
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
ChoosePlayerGetSound(pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_MICRO)))
if (pp->WpnFlags & (BIT(WPN_MICRO)))
break;
pp->WpnFlags |= (BIT(WPN_MICRO));
@ -5537,7 +5537,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_GRENADE));
if (TEST(pp->WpnFlags, BIT(WPN_GRENADE)) && pp->WpnAmmo[WPN_GRENADE] >= DamageData[WPN_GRENADE].max_ammo)
if (pp->WpnFlags & (BIT(WPN_GRENADE)) && pp->WpnAmmo[WPN_GRENADE] >= DamageData[WPN_GRENADE].max_ammo)
break;
//sprintf(ds,"Grenade Launcher");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNGRENADE));
@ -5550,7 +5550,7 @@ KeyMain:
if (StdRandomRange(1000) > 800 && pp == Player+myconnectindex)
PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_GRENADE)))
if (pp->WpnFlags & (BIT(WPN_GRENADE)))
break;
pp->WpnFlags |= (BIT(WPN_GRENADE));
@ -5579,7 +5579,7 @@ KeyMain:
if (pp == Player+myconnectindex)
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
KillGet(actor);
if (TEST(pp->WpnFlags, BIT(WPN_ROCKET)))
if (pp->WpnFlags & (BIT(WPN_ROCKET)))
break;
pp->WpnFlags |= (BIT(WPN_ROCKET));
@ -5607,7 +5607,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_RAIL));
if (TEST(pp->WpnFlags, BIT(WPN_RAIL)) && pp->WpnAmmo[WPN_RAIL] >= DamageData[WPN_RAIL].max_ammo)
if (pp->WpnFlags & (BIT(WPN_RAIL)) && pp->WpnAmmo[WPN_RAIL] >= DamageData[WPN_RAIL].max_ammo)
break;
//sprintf(ds,"Rail Gun");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNRAILGUN));
@ -5624,7 +5624,7 @@ KeyMain:
}
//ChoosePlayerGetSound(pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_RAIL)))
if (pp->WpnFlags & (BIT(WPN_RAIL)))
break;
pp->WpnFlags |= (BIT(WPN_RAIL));
@ -5655,7 +5655,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_SHOTGUN));
if (TEST(pp->WpnFlags, BIT(WPN_SHOTGUN)) && pp->WpnAmmo[WPN_SHOTGUN] >= DamageData[WPN_SHOTGUN].max_ammo)
if (pp->WpnFlags & (BIT(WPN_SHOTGUN)) && pp->WpnAmmo[WPN_SHOTGUN] >= DamageData[WPN_SHOTGUN].max_ammo)
break;
//sprintf(ds,"Riot Gun");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNRIOT));
@ -5666,7 +5666,7 @@ KeyMain:
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
ChoosePlayerGetSound(pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_SHOTGUN)))
if (pp->WpnFlags & (BIT(WPN_SHOTGUN)))
break;
pp->WpnFlags |= (BIT(WPN_SHOTGUN));
@ -5722,7 +5722,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_HOTHEAD));
if (TEST(pp->WpnFlags, BIT(WPN_HOTHEAD)) && pp->WpnAmmo[WPN_HOTHEAD] >= DamageData[WPN_HOTHEAD].max_ammo)
if (pp->WpnFlags & (BIT(WPN_HOTHEAD)) && pp->WpnAmmo[WPN_HOTHEAD] >= DamageData[WPN_HOTHEAD].max_ammo)
break;
//sprintf(ds,"Guardian Head");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNHEAD));
@ -5734,7 +5734,7 @@ KeyMain:
if (StdRandomRange(1000) > 800 && pp == Player+myconnectindex)
PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_HOTHEAD)))
if (pp->WpnFlags & (BIT(WPN_HOTHEAD)))
break;
pp->WpnFlags |= (BIT(WPN_NAPALM) | BIT(WPN_RING) | BIT(WPN_HOTHEAD));
@ -5767,7 +5767,7 @@ KeyMain:
pp->WpnGotOnceFlags |= (BIT(WPN_HEART));
if (TEST(pp->WpnFlags, BIT(WPN_HEART)) && pp->WpnAmmo[WPN_HEART] >= DamageData[WPN_HEART].max_ammo)
if (pp->WpnFlags & (BIT(WPN_HEART)) && pp->WpnAmmo[WPN_HEART] >= DamageData[WPN_HEART].max_ammo)
break;
//sprintf(ds,"Ripper Heart");
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_WPNRIPPER));
@ -5779,7 +5779,7 @@ KeyMain:
if (StdRandomRange(1000) > 800 && pp == Player+myconnectindex)
PlayerSound(DIGI_LIKEBIGWEAPONS, v3df_dontpan|v3df_doppler|v3df_follow,pp);
KillGetWeapon(actor);
if (TEST(pp->WpnFlags, BIT(WPN_HEART)))
if (pp->WpnFlags & (BIT(WPN_HEART)))
break;
pp->WpnFlags |= (BIT(WPN_HEART));
@ -5911,7 +5911,7 @@ void AdjustActiveRange(PLAYERp pp, DSWActor* actor, int dist)
// do not do a FAFcansee if your already active
// Actor only becomes INACTIVE in DoActorDecision
if (TEST(actor->user.Flags, SPR_ACTIVE))
if (actor->user.Flags & (SPR_ACTIVE))
return;
//
@ -6244,7 +6244,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
auto dasect = actor->spr.sector();
auto lastsect = dasect;
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YCENTER))
if (actor->spr.cstat & (CSTAT_SPRITE_YCENTER))
{
zh = 0;
}
@ -6300,7 +6300,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
{
if (retval.type == kHitNone)
{
if (TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_CLIMBING))
{
actor->spr.pos.Z = clippos.Z;
return retval;
@ -6435,7 +6435,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
auto dasect = actor->spr.sector();
auto lastsect = dasect;
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YCENTER))
if (actor->spr.cstat & (CSTAT_SPRITE_YCENTER))
{
zh = 0;
}

View file

@ -1516,7 +1516,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
void DoPlayerZrange(PLAYERp pp);
// make sure your standing on the so
if (TEST(pp->Flags, PF_JUMPING | PF_FALLING | PF_FLYING))
if (pp->Flags & (PF_JUMPING | PF_FALLING | PF_FLYING))
return;
pp->sop_riding = sop;
@ -1544,7 +1544,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
return;
}
if (TEST(pp->Flags, PF_PLAYER_MOVED))
if (pp->Flags & (PF_PLAYER_MOVED))
{
// Player is moving
@ -1717,7 +1717,7 @@ PlayerPart:
else
{
// Sector Objects can either have sprites ON or OFF of the sector
if (TEST(actor->user.Flags, SPR_ON_SO_SECTOR))
if (actor->user.Flags & (SPR_ON_SO_SECTOR))
{
// move with sector its on
actor->spr.pos.Z = actor->spr.sector()->floorz - actor->user.sz;
@ -1732,7 +1732,7 @@ PlayerPart:
int16_t oldang = actor->spr.ang;
actor->spr.ang = actor->user.sang;
if (TEST(actor->user.Flags, SPR_ON_SO_SECTOR))
if (actor->user.Flags & (SPR_ON_SO_SECTOR))
{
if (TEST(sop->flags, SOBJ_DONT_ROTATE))
continue;
@ -2855,7 +2855,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor)
Track[actor->user.track].flags &= ~(TF_TRACK_OCCUPIED);
// jump the current track & determine if you should go to another
if (TEST(actor->user.Flags, SPR_RUN_AWAY))
if (actor->user.Flags & (SPR_RUN_AWAY))
{
// look for another track leading away from the player
actor->user.track = FindTrackAwayFromPlayer(actor);
@ -2871,7 +2871,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor)
actor->user.track = -1;
}
}
else if (TEST(actor->user.Flags, SPR_FIND_PLAYER))
else if (actor->user.Flags & (SPR_FIND_PLAYER))
{
// look for another track leading away from the player
actor->user.track = FindTrackToPlayer(actor);
@ -3310,7 +3310,7 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
}
case TRACK_ACTOR_ZDIFF_MODE:
if (TEST(actor->user.Flags, SPR_ZDIFF_MODE))
if (actor->user.Flags & (SPR_ZDIFF_MODE))
{
actor->user.Flags &= ~(SPR_ZDIFF_MODE);
actor->spr.pos.Z = actor->spr.sector()->floorz;
@ -3434,9 +3434,9 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
return true;
// if lying in wait for player
if (TEST(actor->user.Flags, SPR_WAIT_FOR_PLAYER | SPR_WAIT_FOR_TRIGGER))
if (actor->user.Flags & (SPR_WAIT_FOR_PLAYER | SPR_WAIT_FOR_TRIGGER))
{
if (TEST(actor->user.Flags, SPR_WAIT_FOR_PLAYER))
if (actor->user.Flags & (SPR_WAIT_FOR_PLAYER))
{
TRAVERSE_CONNECT(pnum)
{
@ -3471,7 +3471,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
tpoint = Track[actor->user.track].TrackPoint + actor->user.point;
if (!(TEST(actor->user.Flags, SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
{
actor->spr.ang = getangle(tpoint->x - actor->spr.pos.X, tpoint->y - actor->spr.pos.Y);
}
@ -3485,13 +3485,13 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
NextActorTrackPoint(actor);
tpoint = Track[actor->user.track].TrackPoint + actor->user.point;
if (!(TEST(actor->user.Flags, SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
{
// calculate a new angle to the target
actor->spr.ang = getangle(tpoint->x - actor->spr.pos.X, tpoint->y - actor->spr.pos.Y);
}
if (TEST(actor->user.Flags, SPR_ZDIFF_MODE))
if (actor->user.Flags & (SPR_ZDIFF_MODE))
{
// set dx,dy,dz up for finding the z magnitude
dx = tpoint->x;
@ -3509,7 +3509,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
else
{
// make velocity approach the target velocity
if (TEST(actor->user.Flags, SPR_SPEED_UP))
if (actor->user.Flags & (SPR_SPEED_UP))
{
if ((actor->user.track_vel += (locktics << actor->user.vel_rate)) >= actor->user.vel_tgt)
{
@ -3520,7 +3520,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
// update the real velocity
actor->spr.xvel = (actor->user.track_vel) >> 8;
}
else if (TEST(actor->user.Flags, SPR_SLOW_DOWN))
else if (actor->user.Flags & (SPR_SLOW_DOWN))
{
if ((actor->user.track_vel -= (locktics << actor->user.vel_rate)) <= actor->user.vel_tgt)
{
@ -3534,7 +3534,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
nx = 0;
ny = 0;
if (TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_CLIMBING))
{
if (ActorZOfTop(actor) + (ActorSizeZ(actor) >> 2) < actor->user.sz)
{

View file

@ -93,7 +93,7 @@ void SetVatorActive(DSWActor* actor)
{
SECTORp sectp = actor->spr.sector();
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
StartInterpolation(actor->spr.sector(), Interp_Sect_Ceilingz);
else
StartInterpolation(actor->spr.sector(), Interp_Sect_Floorz);
@ -119,7 +119,7 @@ void SetVatorInactive(DSWActor* actor)
{
SECTORp sectp = actor->spr.sector();
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
StopInterpolation(actor->spr.sector(), Interp_Sect_Ceilingz);
else
StopInterpolation(actor->spr.sector(), Interp_Sect_Floorz);
@ -210,7 +210,7 @@ void DoVatorMatch(PLAYERp pp, short match)
// remember the player than activated it
actor->user.PlayerP = pp;
if (TEST(actor->user.Flags, SPR_ACTIVE))
if (actor->user.Flags & (SPR_ACTIVE))
{
ReverseVator(actor);
continue;
@ -233,7 +233,7 @@ bool TestVatorMatchActive(short match)
if (TEST_BOOL6(actor))
continue;
if (TEST(actor->user.Flags, SPR_ACTIVE) || actor->user.Tics)
if (actor->user.Flags & (SPR_ACTIVE) || actor->user.Tics)
return true;
}
}
@ -248,10 +248,10 @@ void InterpSectorSprites(sectortype* sect, bool state)
{
if (actor->hasU())
{
if (TEST(actor->user.Flags, SPR_SKIP4) && actor->spr.statnum <= STAT_SKIP4_INTERP_END)
if (actor->user.Flags & (SPR_SKIP4) && actor->spr.statnum <= STAT_SKIP4_INTERP_END)
continue;
if (TEST(actor->user.Flags, SPR_SKIP2) && actor->spr.statnum <= STAT_SKIP2_INTERP_END)
if (actor->user.Flags & (SPR_SKIP2) && actor->spr.statnum <= STAT_SKIP2_INTERP_END)
continue;
}
}
@ -299,7 +299,7 @@ void MoveSpritesWithSector(sectortype* sect, int z_amt, bool type)
if (both)
{
// sprite started close to floor
if (TEST(actor->spr.cstat, CSTAT_SPRITE_CLOSE_FLOOR))
if (actor->spr.cstat & (CSTAT_SPRITE_CLOSE_FLOOR))
{
// this is a ceiling
if (type == 1)
@ -368,7 +368,7 @@ int DoVator(DSWActor* actor)
// actor->spr.z - z of the sprite
// actor->user.vel_rate - velocity
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
{
lptr = &sectp->ceilingz;
amt = DoVatorMove(actor, lptr);
@ -519,7 +519,7 @@ int DoVatorAuto(DSWActor* actor)
int *lptr;
int amt;
if (TEST(actor->spr.cstat, CSTAT_SPRITE_YFLIP))
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
{
lptr = &sectp->ceilingz;
amt = DoVatorMove(actor, lptr);

View file

@ -3775,13 +3775,13 @@ int DoVomit(DSWActor* actor)
actor->user.Counter = NORM_ANGLE(actor->user.Counter + (30*MISSILEMOVETICS));
actor->spr.xrepeat = actor->user.sx + MulScale(12, bcos(actor->user.Counter), 14);
actor->spr.yrepeat = actor->user.sy + MulScale(12, bsin(actor->user.Counter), 14);
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
DoJump(actor);
DoShrapMove(actor);
}
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
DoFall(actor);
@ -3848,11 +3848,11 @@ int DoTracerShrap(DSWActor* actor)
int DoShrapJumpFall(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoShrapVelocity(actor);
}
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoShrapVelocity(actor);
}
@ -3874,12 +3874,12 @@ int DoShrapJumpFall(DSWActor* actor)
int DoShrapDamage(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
DoShrapMove(actor);
}
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
DoShrapMove(actor);
@ -4489,12 +4489,12 @@ int DoFireballFlames(DSWActor* actor)
}
else
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
jumping = true;
}
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
jumping = true;
@ -4562,12 +4562,12 @@ int DoBreakFlames(DSWActor* actor)
{
bool jumping = false;
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
{
DoJump(actor);
jumping = true;
}
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
{
DoFall(actor);
jumping = true;
@ -4681,7 +4681,7 @@ void UpdateSinglePlayKills(DSWActor* actor)
// single play and coop kill count
if (gNet.MultiGameType != MULTI_GAME_COMMBAT && actor->hasU())
{
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
{
return;
}
@ -5031,8 +5031,8 @@ int ActorHealth(DSWActor* actor, short amt)
extern STATEp sg_NinjaGrabThroat[];
extern STATEp sg_NinjaHariKari[];
if (TEST(actor->user.Flags2, SPR2_DYING)) return true;
if (TEST(actor->user.Flags, SPR_FALLING | SPR_JUMPING | SPR_CLIMBING)) return true;
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))
{
@ -5190,7 +5190,7 @@ int ActorDamageSlide(DSWActor* actor, int damage, int ang)
{
int slide_vel,slide_dec;
if (TEST(actor->user.Flags, SPR_CLIMBING))
if (actor->user.Flags & (SPR_CLIMBING))
return false;
damage = abs(damage);
@ -5501,7 +5501,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor)
if (actor->user.Attrib && RANDOM_P2(1024) > 850)
PlaySpriteSound(actor,attr_pain,v3df_follow);
if (TEST(actor->user.Flags, SPR_DEAD))
if (actor->user.Flags & (SPR_DEAD))
{
SpawnBlood(actor, weapActor, 0, 0, 0, 0);
return 0;
@ -7104,7 +7104,7 @@ int DoFlamesDamageTest(DSWActor* actor)
if (!TEST(itActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN))
continue;
if (TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
if (actor->spr.cstat & (CSTAT_SPRITE_INVISIBLE))
continue;
if (actor->user.Radius > 200) // Note: No weaps have bigger radius than 200 cept explosion stuff
@ -7380,7 +7380,7 @@ int DoStar(DSWActor* actor)
const int STAR_BOUNCE_RNUM = 600;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->user.motion_blur_num = 0;
ScaleSpriteVector(actor, 54000);
@ -7443,7 +7443,7 @@ int DoStar(DSWActor* actor)
// special case with MissileSetPos - don't queue star
// from this routine
if (TEST(actor->user.Flags, SPR_SET_POS_DONT_KILL))
if (actor->user.Flags & (SPR_SET_POS_DONT_KILL))
break;
// chance of sticking
@ -7659,7 +7659,7 @@ int MissileSeek(DSWActor* actor, int16_t delay_tics, int16_t aware_range/*, int1
{
DSWActor* hitActor;
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
if ((hitActor = PickEnemyTarget(actor, aware_range)) != nullptr)
{
@ -7791,7 +7791,7 @@ int VectorMissileSeek(DSWActor* actor, int16_t delay_tics, int16_t turn_speed, i
{
DSWActor* hitActor;
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
if (actor->user.Flags2 & (SPR2_DONT_TARGET_OWNER))
{
if ((hitActor = PickEnemyTarget(actor, aware_range1)) != nullptr)
{
@ -8032,14 +8032,14 @@ int DoPlasma(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
{
if (WeaponMoveHit(actor))
{
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
{
KillActor(actor);
return true;
@ -8063,7 +8063,7 @@ int DoCoolgFire(DSWActor* actor)
actor->user.coll = move_missile(actor, actor->user.xchange, actor->user.ychange, actor->user.zchange, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
@ -8084,7 +8084,7 @@ int DoCoolgFire(DSWActor* actor)
int DoEelFire(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
return false;
@ -8201,7 +8201,7 @@ int DoGrenade(DSWActor* actor)
{
short i;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
ScaleSpriteVector(actor, 50000);
@ -8219,7 +8219,7 @@ int DoGrenade(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
@ -8347,7 +8347,7 @@ int DoGrenade(DSWActor* actor)
// hit floor
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing underwater
if (actor->user.lo_sectp && actor->spr.sector()->hasU() && FixedToInt(actor->spr.sector()->depth_fixed))
@ -8418,7 +8418,7 @@ int DoGrenade(DSWActor* actor)
ScaleSpriteVector(actorNew, 22000);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -8783,7 +8783,7 @@ void SetMineStuck(DSWActor* actor)
int DoMine(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
// decrease velocity
ScaleSpriteVector(actor, 50000);
@ -8803,7 +8803,7 @@ int DoMine(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
@ -8966,10 +8966,10 @@ int DoBoltThinMan(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return true;
if (actor->user.coll.type != kHitNone)
@ -9267,7 +9267,7 @@ int DoRail(DSWActor* actor)
ScaleSpriteVector(actorNew, 1500);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
}
@ -9308,7 +9308,7 @@ int DoRocket(DSWActor* actor)
PlaySound(DIGI_MINEBEEP, actor, v3df_follow);
}
if (TEST(actor->user.Flags, SPR_FIND_PLAYER))
if (actor->user.Flags & (SPR_FIND_PLAYER))
{
VectorMissileSeek(actor, 30, 16, 128, 768);
}
@ -9317,10 +9317,10 @@ int DoRocket(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return true;
if (actor->user.coll.type != kHitNone)
@ -9360,7 +9360,7 @@ int DoRocket(DSWActor* actor)
ScaleSpriteVector(actorNew, 20000);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
return false;
@ -9427,7 +9427,7 @@ int DoMicro(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (!actor->user.Counter)
@ -9450,7 +9450,7 @@ int DoMicro(DSWActor* actor)
ScaleSpriteVector(actorNew, 20000);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
// last smoke
@ -9501,7 +9501,7 @@ int DoUziBullet(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 128)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 128)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
@ -9555,7 +9555,7 @@ int DoBoltSeeker(DSWActor* actor)
actor->user.coll = move_missile(actor, dax, day, daz, CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS);
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
@ -9597,10 +9597,10 @@ int DoElectro(DSWActor* actor)
actor->user.coll = move_missile(actor, dax, day, daz, CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS);
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return true;
if (actor->user.coll.type != kHitNone)
@ -9636,10 +9636,10 @@ int DoLavaBoulder(DSWActor* actor)
actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return true;
if (actor->user.coll.type != kHitNone)
@ -9662,10 +9662,10 @@ int DoSpear(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return true;
if (actor->user.coll.type != kHitNone)
@ -9711,7 +9711,7 @@ int SpawnCoolieExp(DSWActor* actor)
void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
return;
if (enemyActor != nullptr)
@ -9880,7 +9880,7 @@ void SpawnFireballExp(DSWActor* actor)
{
ASSERT(actor->hasU());
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return;
PlaySound(DIGI_SMALLEXP, actor, v3df_none);
@ -9894,7 +9894,7 @@ void SpawnFireballExp(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->spr.pal = actorNew->user.spal = actor->user.spal;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->user.Flags |= (TEST(actor->user.Flags,SPR_UNDERWATER));
actorNew->user.Flags |= (actor->user.Flags & (SPR_UNDERWATER));
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
//
@ -9912,7 +9912,7 @@ void SpawnGoroFireballExp(DSWActor* actor)
{
ASSERT(actor->hasU());
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return;
PlaySound(DIGI_MEDIUMEXP, actor, v3df_none);
@ -10267,7 +10267,7 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECTp sop,
expActor->user.Flags |= (actor->user.Flags & (SPR_ON_SO_SECTOR|SPR_SO_ATTACHED));
if (TEST(actor->user.Flags, SPR_ON_SO_SECTOR))
if (actor->user.Flags & (SPR_ON_SO_SECTOR))
{
// move with sector its on
expActor->spr.pos.Z = actor->spr.sector()->floorz - actor->user.sz;
@ -10482,7 +10482,7 @@ DSWActor* SpawnSectorExp(DSWActor* actor)
short explosion;
ASSERT(actor->hasU());
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return nullptr;
PlaySound(DIGI_30MMEXPLODE, actor, v3df_none);
@ -10536,7 +10536,7 @@ void SpawnMeteorExp(DSWActor* actor)
DSWActor* expActor;
ASSERT(actor->hasU());
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return;
if (actor->user.spal == 25) // Serp ball
@ -10591,7 +10591,7 @@ void SpawnLittleExp(DSWActor* actor)
int DoFireball(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->spr.xrepeat = actor->spr.yrepeat -= 1;
if (actor->spr.xrepeat <= 37)
@ -10755,7 +10755,7 @@ int DoNapalm(DSWActor* actor)
DoBlurExtend(actor, 1, 7);
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->spr.xrepeat = actor->spr.yrepeat -= 1;
if (actor->spr.xrepeat <= 30)
@ -10774,7 +10774,7 @@ int DoNapalm(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
{
@ -10827,7 +10827,7 @@ int DoNapalm(DSWActor* actor)
expActor->spr.pos.Z = expActor->user.loz;
expActor->spr.backupz();
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
expActor->user.Flags |= SPR_UNDERWATER;
ASSERT(expActor->spr.picnum == 3072);
@ -10984,7 +10984,7 @@ int DoMirvMissile(DSWActor* actor)
actor->user.coll = move_missile(actor, actor->user.xchange, actor->user.ychange, actor->user.zchange, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
if (actor->user.coll.type != kHitNone)
@ -11005,7 +11005,7 @@ int DoMirv(DSWActor* actor)
MissileHitDiveArea(actor);
if (TEST(actor->user.Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
if (actor->user.Flags & (SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256)
SpawnBubble(actor);
@ -11047,7 +11047,7 @@ int DoMirv(DSWActor* actor)
actorNew->user.ychange = MOVEy(actorNew->spr.xvel, actorNew->spr.ang);
actorNew->user.zchange = actorNew->spr.zvel;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -11159,7 +11159,7 @@ int DoRing(DSWActor* actor)
PLAYERp pp = own->user.PlayerP;;
int cz,fz;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->spr.xrepeat = actor->spr.yrepeat -= 1;
if (actor->spr.xrepeat <= 30)
@ -11286,7 +11286,7 @@ void InitSpellRing(PLAYERp pp)
actorNew->spr.backuppos();
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
}
@ -11329,7 +11329,7 @@ int DoSerpRing(DSWActor* actor)
actor->user.slide_ang = NORM_ANGLE(actor->user.slide_ang + actor->spr.yvel);
// rotate the heads
if (TEST(actor->user.Flags, SPR_BOUNCE))
if (actor->user.Flags & (SPR_BOUNCE))
actor->spr.ang = NORM_ANGLE(actor->spr.ang + (28 * RINGMOVETICS));
else
actor->spr.ang = NORM_ANGLE(actor->spr.ang - (28 * RINGMOVETICS));
@ -11558,7 +11558,7 @@ int InitSerpRing(DSWActor* actor)
// control direction of spinning
actor->user.Flags ^= SPR_BOUNCE;
actorNew->user.Flags |= (TEST(actor->user.Flags, SPR_BOUNCE));
actorNew->user.Flags |= (actor->user.Flags & (SPR_BOUNCE));
actorNew->user.Dist = 600;
actorNew->user.TargetDist = SERP_RING_DIST;
@ -11659,7 +11659,7 @@ void InitSpellNapalm(PLAYERp pp)
continue;
}
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actor))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actor))
actor->user.Flags |= (SPR_UNDERWATER);
plActor->spr.clipdist = oclipdist;
@ -11835,7 +11835,7 @@ int InitSwordAttack(PLAYERp pp)
PlaySound(DIGI_SWORDSWOOSH, pp, v3df_dontpan | v3df_doppler);
if (TEST(pp->Flags, PF_DIVING))
if (pp->Flags & (PF_DIVING))
{
DSWActor* bubble;
int nx, ny;
@ -12007,7 +12007,7 @@ int InitFistAttack(PLAYERp pp)
PlaySound(DIGI_STAR, pp, v3df_dontpan|v3df_doppler);
if (TEST(pp->Flags, PF_DIVING))
if (pp->Flags & (PF_DIVING))
{
DSWActor* bubble;
int nx,ny;
@ -12299,7 +12299,7 @@ int InitSumoSkull(DSWActor* actor)
// control direction of spinning
actor->user.Flags ^= SPR_BOUNCE;
actorNew->user.Flags |= (TEST(actor->user.Flags, SPR_BOUNCE));
actorNew->user.Flags |= (actor->user.Flags & (SPR_BOUNCE));
actorNew->user.StateEnd = s_SkullExplode;
actorNew->user.Rot = sg_SkullWait;
@ -12685,7 +12685,7 @@ int InitStar(PLAYERp pp)
actorNew->user.ychange = MOVEy(actorNew->spr.xvel, actorNew->spr.ang);
actorNew->user.zchange = zvel;
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
actorNew->spr.backuppos();
@ -12706,7 +12706,7 @@ int InitStar(PLAYERp pp)
actorNew2->user.floor_dist = actorNew->user.floor_dist;
actorNew2->user.Flags2 = actorNew->user.Flags2 & ~(SPR2_FLAMEDIE); // mask out any new flags here for safety.
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew2))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew2))
actorNew2->user.Flags |= SPR_UNDERWATER;
zvel = -MulScale(pp->horizon.horiz.asq16(), HORIZ_MULT+STAR_HORIZ_ADJ, 16);
@ -13084,7 +13084,7 @@ int InitLaser(PLAYERp pp)
HelpMissileLateral(actorNew, 900);
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// the slower the missile travels the less of a zvel it needs
@ -13188,7 +13188,7 @@ int InitRail(PLAYERp pp)
HelpMissileLateral(actorNew, 700);
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
if (TestMissileSetPos(actorNew, DoRailStart, 1200, zvel))
@ -13370,7 +13370,7 @@ int InitRocket(PLAYERp pp)
HelpMissileLateral(actorNew, 900);
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// cancel smoke trail
@ -13475,7 +13475,7 @@ int InitBunnyRocket(PLAYERp pp)
HelpMissileLateral(actorNew, 900);
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// cancel smoke trail
@ -13568,7 +13568,7 @@ int InitNuke(PLAYERp pp)
HelpMissileLateral(actorNew, 900);
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// cancel smoke trail
@ -13755,7 +13755,7 @@ int InitMicro(PLAYERp pp)
HelpMissileLateral(actorNew, 1000 + (RandomRange(MICRO_LATERAL) - (MICRO_LATERAL / 2)));
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
// cancel smoke trail
@ -14159,7 +14159,7 @@ int InitSerpSpell(DSWActor* actor)
MissileSetPos(actorNew, DoMirvMissile, 400);
actor->spr.clipdist = oclipdist;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -14168,7 +14168,7 @@ int InitSerpSpell(DSWActor* actor)
int SpawnDemonFist(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_SUICIDE))
if (actor->user.Flags & (SPR_SUICIDE))
return -1;
auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->spr.sector(),
@ -14257,7 +14257,7 @@ int InitSerpMonstSpell(DSWActor* actor)
MissileSetPos(actorNew, DoMirvMissile, 400);
actor->spr.clipdist = oclipdist;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actorNew->user.Flags |= (SPR_UNDERWATER);
}
@ -14942,7 +14942,7 @@ int InitTracerUzi(PLAYERp pp)
plActor->spr.clipdist = 0;
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang + 512);
if (TEST(pp->Flags, PF_TWO_UZI) && pp->WpnUziType == 0)
if (pp->Flags & (PF_TWO_UZI) && pp->WpnUziType == 0)
HelpMissileLateral(actorNew, lat_dist[RANDOM_P2(2<<8)>>8]);
else
HelpMissileLateral(actorNew, lat_dist[0]);
@ -14968,7 +14968,7 @@ int InitTracerUzi(PLAYERp pp)
actorNew->user.ychange = MOVEy(actorNew->spr.xvel, actorNew->spr.ang);
actorNew->user.zchange = actorNew->spr.zvel;
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
return 0;
@ -15072,7 +15072,7 @@ int BulletHitSprite(DSWActor* actor, DSWActor* hitActor, int hit_x, int hit_y, i
//if(!hitActor->user.PlayerP)
if (actor->user.PlayerP)
id = UZI_SMOKE;
else if (TEST(actor->user.Flags, SPR_SO_ATTACHED))
else if (actor->user.Flags & (SPR_SO_ATTACHED))
id = UZI_SMOKE;
else // Spawn NPC uzi with less damage
id = UZI_SMOKE+2;
@ -16402,7 +16402,7 @@ int InitGrenade(PLAYERp pp)
nx, ny, nz, pp->angle.ang.asbuild(), GRENADE_VELOCITY);
// don't throw it as far if crawling
if (TEST(pp->Flags, PF_CRAWLING))
if (pp->Flags & (PF_CRAWLING))
{
actorNew->spr.xvel -= (actorNew->spr.xvel >> 2);
}
@ -16425,7 +16425,7 @@ int InitGrenade(PLAYERp pp)
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat |= (CSTAT_SPRITE_BLOCK);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
actorNew->spr.zvel = -pp->horizon.horiz.asq16() >> 9;
@ -16561,7 +16561,7 @@ int InitMine(PLAYERp pp)
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->user.spal = actorNew->spr.pal = actor->user.spal; // Set sticky color
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
MissileSetPos(actorNew, DoMine, 800);
@ -16696,7 +16696,7 @@ int InitFireball(PLAYERp pp)
HelpMissileLateral(actorNew, 2100);
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 512);
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew))
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
actorNew->user.Flags |= (SPR_UNDERWATER);
if (TestMissileSetPos(actorNew, DoFireball, 1200, MulScale(zvel,44000, 16)))
@ -17537,7 +17537,7 @@ int QueueFloorBlood(DSWActor* actor)
if (TEST(sectp->extra, SECTFX_SINK)||TEST(sectp->extra, SECTFX_CURRENT))
return -1; // No blood in water or current areas
if (TEST(actor->user.Flags, SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || SpriteInDiveArea(actor))
if (actor->user.Flags & (SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || SpriteInDiveArea(actor))
return -1; // No blood underwater!
if (TEST(actor->spr.sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
@ -17627,7 +17627,7 @@ int QueueFootPrint(DSWActor* actor)
Found = true;
}
if (TEST(actor->user.Flags, SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || Found || SpriteInDiveArea(actor))
if (actor->user.Flags & (SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || Found || SpriteInDiveArea(actor))
return -1; // No prints underwater!
if (TEST(actor->spr.sector()->extra, SECTFX_LIQUID_MASK) == SECTFX_LIQUID_WATER)
@ -17736,7 +17736,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
int daz;
HitInfo hit{};
if (TEST(actor->user.Flags, SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || SpriteInDiveArea(actor))
if (actor->user.Flags & (SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || SpriteInDiveArea(actor))
return nullptr; // No blood underwater!
daz = Z(RANDOM_P2(128))<<3;
@ -18007,7 +18007,7 @@ int DoShellShrap(DSWActor* actor)
int DoShrapVelocity(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER) || SpriteInUnderwaterArea(actor))
if (actor->user.Flags & (SPR_UNDERWATER) || SpriteInUnderwaterArea(actor))
{
ScaleSpriteVector(actor, 20000);
@ -18101,7 +18101,7 @@ int DoShrapVelocity(DSWActor* actor)
if (actor->spr.pos.Z > ((actor->user.hiz + actor->user.loz) >> 1))
{
actor->spr.pos.Z = actor->user.loz;
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
actor->user.Flags |= (SPR_BOUNCE); // no bouncing underwater
if (actor->user.lo_sectp && actor->spr.sector()->hasU() && FixedToInt(actor->spr.sector()->depth_fixed))
@ -18323,7 +18323,7 @@ bool CheckBreakToughness(BREAK_INFOp break_info, int ID)
int DoItemFly(DSWActor* actor)
{
if (TEST(actor->user.Flags, SPR_UNDERWATER))
if (actor->user.Flags & (SPR_UNDERWATER))
{
ScaleSpriteVector(actor, 50000);

View file

@ -864,16 +864,16 @@ int DoZombieMove(DSWActor* actor)
}
// jumping and falling
if (TEST(actor->user.Flags, SPR_JUMPING | SPR_FALLING))
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
{
if (TEST(actor->user.Flags, SPR_JUMPING))
if (actor->user.Flags & (SPR_JUMPING))
DoActorJump(actor);
else if (TEST(actor->user.Flags, SPR_FALLING))
else if (actor->user.Flags & (SPR_FALLING))
DoActorFall(actor);
}
// sliding
if (TEST(actor->user.Flags, SPR_SLIDING))
if (actor->user.Flags & (SPR_SLIDING))
DoActorSlide(actor);
// Do track or call current action function - such as DoActorMoveCloser()
@ -917,7 +917,7 @@ int NullZombie(DSWActor* actor)
if (actor->user.WaitTics > 0)
actor->user.WaitTics -= ACTORMOVETICS;
if (TEST(actor->user.Flags, SPR_SLIDING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
if (actor->user.Flags & (SPR_SLIDING) && !TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))
DoActorSlide(actor);
if (!TEST(actor->user.Flags, SPR_JUMPING|SPR_FALLING))