From b6fdcff5e2537ee78caf534ef579041d8d6c2003 Mon Sep 17 00:00:00 2001 From: Kyep Date: Thu, 2 Aug 2018 09:32:04 -0700 Subject: [PATCH] splits teleportation fixes out of depot PR #8515 --- code/game/objects/items/weapons/teleportation.dm | 15 ++++++++++----- code/modules/hydroponics/plant_genes.dm | 11 +++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 501bfaa5db7..17fb0b9745a 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -108,9 +108,11 @@ Frequency: /obj/item/hand_tele/attack_self(mob/user as mob) var/turf/current_location = get_turf(user)//What turf is the user on? - if(!current_location||!is_teleport_allowed(current_location.z))//If turf was not found or they're somewhere teleproof + var/area/current_area = get_area(user) + if(!current_location || !is_teleport_allowed(current_location.z) || current_area.tele_proof)//If turf was not found or they're somewhere teleproof to_chat(user, "\The [src] is malfunctioning.") return + var/list/L = list( ) for(var/obj/machinery/computer/teleporter/com in world) if(com.target) @@ -118,13 +120,16 @@ Frequency: L["[com.id] (Active)"] = com.target else L["[com.id] (Inactive)"] = com.target - var/list/turfs = list( ) + var/list/turfs = list() var/area/A for(var/turf/T in orange(10)) - if(T.x>world.maxx-8 || T.x<8) continue //putting them at the edge is dumb - if(T.y>world.maxy-8 || T.y<8) continue + if(T.x>world.maxx-8 || T.x<8) + continue //putting them at the edge is dumb + if(T.y>world.maxy-8 || T.y<8) + continue A = get_area(T) - if(A.tele_proof == 1) continue // Telescience-proofed areas require a beacon. + if(A.tele_proof == 1) + continue // Telescience-proofed areas require a beacon. turfs += T if(turfs.len) L["None (Dangerous)"] = pick(turfs) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 5b4a35262d7..f4e8e60f948 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -307,14 +307,21 @@ /datum/plant_gene/trait/teleport/on_squash(obj/item/reagent_containers/food/snacks/grown/G, atom/target) if(isliving(target)) - var/teleport_radius = max(round(G.seed.potency / 10), 1) var/turf/T = get_turf(target) + var/area/A = get_area(T) + if(!T || !is_teleport_allowed(T.z) || A.tele_proof) + return + var/teleport_radius = max(round(G.seed.potency / 10), 1) new /obj/effect/decal/cleanable/molten_object(T) //Leave a pile of goo behind for dramatic effect... do_teleport(target, T, teleport_radius) /datum/plant_gene/trait/teleport/on_slip(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/C) - var/teleport_radius = max(round(G.seed.potency / 10), 1) var/turf/T = get_turf(C) + var/area/A = get_area(T) + if(!T || !is_teleport_allowed(T.z) || A.tele_proof) + qdel(G) + return + var/teleport_radius = max(round(G.seed.potency / 10), 1) to_chat(C, "You slip through spacetime!") do_teleport(C, T, teleport_radius) if(prob(50))