allow targeting invulnerable bosses

This commit is contained in:
katsy 2023-01-05 14:11:54 -06:00
parent 71736f358f
commit 3a04e11743
2 changed files with 2 additions and 11 deletions

View file

@ -1453,7 +1453,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
if (
P_MobjWasRemoved(ticcmd_ztargetfocus[forplayer]) ||
!ticcmd_ztargetfocus[forplayer]->health ||
(ticcmd_ztargetfocus[forplayer]->flags2 & MF2_FRET) ||
(ticcmd_ztargetfocus[forplayer]->type == MT_EGGMOBILE3 && !ticcmd_ztargetfocus[forplayer]->movecount) // Sea Egg is moving around underground and shouldn't be tracked
)
P_SetTarget(&ticcmd_ztargetfocus[forplayer], NULL);

View file

@ -9059,10 +9059,6 @@ mobj_t *P_LookForFocusTarget(player_t *player, mobj_t *exclude, SINT8 direction,
switch (mo->type)
{
case MT_TNTBARREL:
if (lockonflags & LOCK_INTERESTS)
break;
/*FALLTHRU*/
case MT_PLAYER: // Don't chase other players!
case MT_DETON:
continue; // Don't be STUPID, Sonic!
@ -9083,17 +9079,13 @@ mobj_t *P_LookForFocusTarget(player_t *player, mobj_t *exclude, SINT8 direction,
/*FALLTHRU*/
default:
if ((lockonflags & LOCK_BOSS) && ((mo->flags & (MF_BOSS|MF_SHOOTABLE)) == (MF_BOSS|MF_SHOOTABLE))) // allows if it has the flags desired XOR it has the invert aimable flag
{
if (mo->flags2 & MF2_FRET)
continue;
if ((lockonflags & LOCK_BOSS) && (mo->flags & MF_BOSS)) // always allow targeting bosses
break;
}
if ((lockonflags & LOCK_ENEMY) && (!((mo->flags & (MF_ENEMY|MF_SHOOTABLE)) == (MF_ENEMY|MF_SHOOTABLE)) != !(mo->flags2 & MF2_INVERTAIMABLE))) // allows if it has the flags desired XOR it has the invert aimable flag
break;
if ((lockonflags & LOCK_INTERESTS) && (mo->flags & (MF_PUSHABLE|MF_MONITOR))) // allows if it has the flags desired XOR it has the invert aimable flag
if ((lockonflags & LOCK_INTERESTS) && (mo->flags & (MF_PUSHABLE|MF_MONITOR))) // allows if it has the flags desired
break;
continue; // not a valid object