use MF2_AMBUSH for backandforth

This commit is contained in:
TehRealSalt 2019-09-27 04:20:09 -04:00
parent 22796b7633
commit dbb6f9ca11
2 changed files with 9 additions and 5 deletions

View file

@ -293,14 +293,18 @@ static void K_SetupMovingCapsule(mapthing_t *mt, mobj_t *mobj)
mobj->movecount = target->health; mobj->movecount = target->health;
mobj->movefactor = speed; mobj->movefactor = speed;
if (backandforth) if (backandforth) {
mobj->cusval = 1; mobj->flags2 |= MF2_AMBUSH;
} else {
mobj->flags2 &= ~MF2_AMBUSH;
}
if (reverse) if (reverse) {
mobj->cvmem = -1; mobj->cvmem = -1;
else } else {
mobj->cvmem = 1; mobj->cvmem = 1;
} }
}
void K_SpawnBattleCapsules(void) void K_SpawnBattleCapsules(void)
{ {

View file

@ -9377,7 +9377,7 @@ void P_MobjThinker(mobj_t *mobj)
fixed_t speed = mobj->movefactor; fixed_t speed = mobj->movefactor;
UINT8 sequence = mobj->lastlook; UINT8 sequence = mobj->lastlook;
UINT8 num = mobj->movecount; UINT8 num = mobj->movecount;
boolean backandforth = mobj->cusval; boolean backandforth = (mobj->flags2 & MF2_AMBUSH);
SINT8 direction = mobj->cvmem; SINT8 direction = mobj->cvmem;
mobj_t *next = NULL; mobj_t *next = NULL;
thinker_t *th; thinker_t *th;