mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Merge branch 'targetproblem' into 'next'
Homing Targetting Issues See merge request STJr/SRB2!671
This commit is contained in:
commit
34b42507d1
1 changed files with 8 additions and 4 deletions
12
src/p_user.c
12
src/p_user.c
|
@ -9279,6 +9279,7 @@ mobj_t *P_LookForFocusTarget(player_t *player, mobj_t *exclude, SINT8 direction,
|
|||
// If nonenemies is true, includes monitors and springs!
|
||||
// If bullet is true, you can look up and the distance is further,
|
||||
// but your total angle span you can look is limited to compensate. (Also, allows monitors.)
|
||||
// If you modify this, please also modify P_HomingAttack.
|
||||
//
|
||||
mobj_t *P_LookForEnemies(player_t *player, boolean nonenemies, boolean bullet)
|
||||
{
|
||||
|
@ -9374,15 +9375,18 @@ boolean P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
|
|||
if (!enemy)
|
||||
return false;
|
||||
|
||||
if (!enemy->health)
|
||||
if (enemy->flags & MF_NOCLIPTHING)
|
||||
return false;
|
||||
|
||||
if (enemy->health <= 0) // dead
|
||||
return false;
|
||||
|
||||
if (!((enemy->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR) && (enemy->flags & MF_SHOOTABLE)) || (enemy->flags & MF_SPRING)) == !(enemy->flags2 & MF2_INVERTAIMABLE)) // allows if it has the flags desired XOR it has the invert aimable flag
|
||||
return false;
|
||||
|
||||
if (enemy->flags2 & MF2_FRET)
|
||||
return false;
|
||||
|
||||
if (!(enemy->flags & (MF_SHOOTABLE|MF_SPRING)) == !(enemy->flags2 & MF2_INVERTAIMABLE)) // allows if it has the flags desired XOR it has the invert aimable flag
|
||||
return false;
|
||||
|
||||
// change angle
|
||||
source->angle = R_PointToAngle2(source->x, source->y, enemy->x, enemy->y);
|
||||
if (source->player)
|
||||
|
|
Loading…
Reference in a new issue