From d8e05c16c8a0b7598fa490f39ecdc89828fb33a2 Mon Sep 17 00:00:00 2001 From: Geeves <22774890+Geevies@users.noreply.github.com> Date: Tue, 12 Aug 2025 18:30:44 +0200 Subject: [PATCH] Portal Fix (#21158) * Fixes telescience portals not working correctly, causing an infinite loop. --- code/datums/helper_datums/teleport.dm | 11 +++++++++++ html/changelogs/geeves-portal_fix.yml | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 html/changelogs/geeves-portal_fix.yml 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."