From 9c8954cda518667a4e691a69b40926db698bd368 Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Thu, 9 Jan 2025 19:50:02 +0000 Subject: [PATCH] Fix some inverted teleport validation checks (#88967) ## About The Pull Request A bunch of places in code were recently updated to use a helper proc for validating teleportation. Unfortunately a lot of them also got the return value inverted, and would only let you teleport to illegal locations. Most notably this effected the hand teleporter, but also several other items. Fixes #88966 what is a "dull universal force" supposed to be anyway --- code/datums/components/dejavu.dm | 2 +- code/game/objects/items/implants/security/implant_beacon.dm | 2 +- code/game/objects/items/teleportation.dm | 2 +- code/modules/mod/modules/modules_timeline.dm | 2 +- code/modules/vehicles/mecha/_mecha.dm | 2 +- code/modules/vehicles/mecha/equipment/tools/other_tools.dm | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/datums/components/dejavu.dm b/code/datums/components/dejavu.dm index 38bec8a25c6..9407423800c 100644 --- a/code/datums/components/dejavu.dm +++ b/code/datums/components/dejavu.dm @@ -81,7 +81,7 @@ //comes after healing so new limbs comically drop to the floor if(starting_turf) - if(check_teleport_valid(parent, starting_turf)) + if(!check_teleport_valid(parent, starting_turf)) to_chat(parent, span_warning("For some reason, your head aches and fills with mental fog when you try to think of where you were... It feels like you're now going against some dull, unstoppable universal force.")) else var/atom/movable/master = parent diff --git a/code/game/objects/items/implants/security/implant_beacon.dm b/code/game/objects/items/implants/security/implant_beacon.dm index 126d0e8f1b4..e6b3e3571c7 100644 --- a/code/game/objects/items/implants/security/implant_beacon.dm +++ b/code/game/objects/items/implants/security/implant_beacon.dm @@ -25,7 +25,7 @@ var/list/info_shown = ..() var/area/destination_area = get_area(imp_in) - if(isnull(destination_area) || check_teleport_valid(imp_in, usr)) + if(isnull(destination_area) || !check_teleport_valid(imp_in, usr)) info_shown["Status"] = "Implant carrier teleport signal cannot be reached!" else var/turf/turf_to_check = get_turf(imp_in) diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index 4ceae79f673..56461f05865 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -285,7 +285,7 @@ ///Is, for some reason, separate from the teleport target's check in try_create_portal_to() /obj/item/hand_tele/proc/can_teleport_notifies(mob/user) var/turf/current_location = get_turf(user) - if (!current_location || check_teleport_valid(src, current_location) || is_away_level(current_location.z) || !isturf(user.loc)) + if (!current_location || !check_teleport_valid(src, current_location) || is_away_level(current_location.z) || !isturf(user.loc)) to_chat(user, span_notice("[src] is malfunctioning.")) return FALSE diff --git a/code/modules/mod/modules/modules_timeline.dm b/code/modules/mod/modules/modules_timeline.dm index d16f45f3545..654aaa0e8ee 100644 --- a/code/modules/mod/modules/modules_timeline.dm +++ b/code/modules/mod/modules/modules_timeline.dm @@ -159,7 +159,7 @@ /obj/item/mod/module/timeline_jumper/used() var/area/noteleport_check = get_area(mod.wearer) - if(noteleport_check && check_teleport_valid(mod.wearer, get_turf(mod.wearer))) + if(noteleport_check && !check_teleport_valid(mod.wearer, get_turf(mod.wearer))) to_chat(mod.wearer, span_danger("Some dull, universal force is between you and the [phased_mob ? "current timeline" : "stream between timelines"].")) return FALSE return ..() diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 202eba2e798..e4330bb3b90 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -432,7 +432,7 @@ if(phase_state) flick(phase_state, src) var/turf/destination_turf = get_step(loc, movement_dir) - if(check_teleport_valid(src, destination_turf) || SSmapping.level_trait(destination_turf.z, ZTRAIT_NOPHASE)) + if(!check_teleport_valid(src, destination_turf) || SSmapping.level_trait(destination_turf.z, ZTRAIT_NOPHASE)) return FALSE return TRUE diff --git a/code/modules/vehicles/mecha/equipment/tools/other_tools.dm b/code/modules/vehicles/mecha/equipment/tools/other_tools.dm index 77517dde12e..613f82fe859 100644 --- a/code/modules/vehicles/mecha/equipment/tools/other_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/other_tools.dm @@ -14,7 +14,7 @@ var/teleport_range = 7 /obj/item/mecha_parts/mecha_equipment/teleporter/action(mob/source, atom/target, list/modifiers) - if(!action_checks(target) || check_teleport_valid(source, target, TELEPORT_CHANNEL_BLUESPACE)) + if(!action_checks(target) || !check_teleport_valid(source, target, TELEPORT_CHANNEL_BLUESPACE)) return var/turf/T = get_turf(target) if(T && (loc.z == T.z) && (get_dist(loc, T) <= teleport_range)) @@ -35,7 +35,7 @@ /obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(mob/source, atom/target, list/modifiers) - if(!action_checks(target) || check_teleport_valid(source, target, TELEPORT_CHANNEL_WORMHOLE)) + if(!action_checks(target) || !check_teleport_valid(source, target, TELEPORT_CHANNEL_WORMHOLE)) return var/area/targetarea = pick(get_areas_in_range(100, chassis)) if(!targetarea)//Literally middle of nowhere how did you even get here