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
This commit is contained in:
Jacquerel
2025-01-09 13:50:02 -06:00
committed by GitHub
parent cefde77beb
commit 9c8954cda5
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 ..()
+1 -1
View File
@@ -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
@@ -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