Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions yogstation/code/game/objects/items/implants/implant_teleporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,36 @@
useblacklist = FALSE

if(imp_in)
if(!is_centcom_level(imp_in.z)) //teleporting doesn't work on centcom
var/turf/T = get_turf_global(imp_in)
if(!is_centcom_level(T.z)) //teleporting doesn't work on centcom

if(blacklist.len && useblacklist)
var/i = 0
for(var/zlevel in blacklist)
i++
if(zlevel == imp_in.z)
if(zlevel == T.z)
if(on && pointofreturn)
retrieve_exile()
else
break //we're on a blacklisted z but not on (e.g. station prior to being exiled) so stop
else
if(!on && i >= blacklist.len) //we've just arrived on a non-blacklisted z, start blocking
on = TRUE
pointofreturn = imp_in.loc //we'll teleport back here if we go out of bounds
pointofreturn = T //we'll teleport back here if we go out of bounds

if(whitelist.len && usewhitelist)
for(var/zlevel in whitelist)
if(zlevel == imp_in.z)
if(zlevel == T.z)
if(!on)
on = TRUE //we're on a whitelisted z, start blocking
pointofreturn = imp_in.loc //we'll teleport back here if we go out of bounds
pointofreturn = T //we'll teleport back here if we go out of bounds
return // we're allowed here, stop

if(on && pointofreturn)
retrieve_exile()

/obj/item/implant/teleporter/proc/retrieve_exile()
if(!is_centcom_level(imp_in.z))
var/turf/T = get_turf_global(imp_in)
if(!is_centcom_level(T.z))
do_teleport(imp_in, pointofreturn, 0, channel = TELEPORT_CHANNEL_WORMHOLE)
say(retrievalmessage)

Expand Down Expand Up @@ -80,14 +81,13 @@

if(user)
log_combat(user, target, "implanted", object="[name]")

var/turf/T = get_turf_global(imp_in)
if(useblacklist && !blacklist.len)
blacklist += imp_in.z
blacklist += T.z

if(usewhitelist && !whitelist.len)
whitelist += imp_in.z
pointofreturn = imp_in.loc

whitelist += T.z
pointofreturn = T
return 1

/obj/item/implant/teleporter/removed(mob/living/source, silent = 0, special = 0)
Expand Down