Skip to content

Commit

Permalink
Smoother retargetting
Browse files Browse the repository at this point in the history
  • Loading branch information
Halonexus committed Dec 17, 2024
1 parent 4eb1ecb commit 79d7d0f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions code/modules/mob/living/simple_animal/hostile/hostile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,17 @@
target and they suddenly or are currently something
we dont attack.*/
if(QDELETED(target))
if(approaching_target)
/* Approaching target means we are currently moving menacingly
towards something. Otherwise we are just moving and if we
are investigating a location we dont want to be told to stand still. */
LoseTarget()
return FALSE
if(!FindTarget(possible_targets, TRUE))
if(approaching_target)
/* Approaching target means we are currently moving menacingly
towards something. Otherwise we are just moving and if we
are investigating a location we dont want to be told to stand still. */
LoseTarget()
return FALSE
if(!CanAttack(target))
LoseTarget()
return FALSE
if(!FindTarget(possible_targets, TRUE))
LoseTarget()
return FALSE
// The target we currently have is in our view and we must decide if we move towards it more.
if(target in possible_targets)
var/turf/T = get_turf(src)
Expand Down

0 comments on commit 79d7d0f

Please sign in to comment.