Fix Space Carp trying to go into portals for no reason (#90679)

This commit is contained in:
Jacquerel
2025-04-29 18:28:51 -06:00
committed by Shadow-Quill
parent 1dbe3038de
commit 894ce4b17b
2 changed files with 3 additions and 2 deletions
@@ -137,6 +137,7 @@
if (isliving(entered_atom))
var/mob/living/teleported_mob = entered_atom
teleported_mob.changeNext_move(disorient_time)
teleported_mob.ai_controller?.CancelActions()
var/turf/destination = pick(exit_locs)
do_teleport(entered_atom, destination, channel = TELEPORT_CHANNEL_MAGIC)
@@ -201,7 +201,7 @@
if (!exit_count)
continue
var/turf/rift_exit = rift.exit_locs[exit_count]
if (get_dist(rift_exit, target) >= distance_to_target)
if ((get_dist(rift_exit, target) + get_dist(rift, target)) >= distance_to_target)
continue
controller.queue_behavior(/datum/ai_behavior/travel_towards_atom, get_turf(rift))
controller.queue_behavior(/datum/ai_behavior/travel_towards_atom, rift)
return SUBTREE_RETURN_FINISH_PLANNING