diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index ef87073e8f2..4e25a93d9d2 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -146,6 +146,14 @@ playSpecials(curturf,effectin,soundin) + // we don't want a teleportation loop, if we teleport to a destination that already has a portal + // disable it for just a moment until we get there + var/has_active_destination_portal = FALSE + var/obj/effect/portal/destination_portal = locate() in destturf + if(destination_portal?.does_teleport) + has_active_destination_portal = TRUE + destination_portal.does_teleport = FALSE + var/obj/structure/bed/stool/chair/C = null if(isliving(teleatom)) var/mob/living/L = teleatom @@ -270,6 +278,9 @@ destarea.Entered(teleatom) + if(has_active_destination_portal) + destination_portal.does_teleport = TRUE + return TRUE /datum/teleport/proc/teleport() diff --git a/html/changelogs/geeves-portal_fix.yml b/html/changelogs/geeves-portal_fix.yml new file mode 100644 index 00000000000..db7d3670028 --- /dev/null +++ b/html/changelogs/geeves-portal_fix.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Fixes telescience portals not working correctly, causing an infinite loop."