Fixes ghost teleport menu (#16858)

* fixes ghost jumping

* use SSmapping.ghostteleportlocs
This commit is contained in:
S34N
2021-10-04 20:14:16 +01:00
committed by GitHub
parent 2aa0abde72
commit f641f1f6ef
+11 -12
View File
@@ -389,23 +389,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!isobserver(usr))
to_chat(usr, "Not when you're not dead!")
return
var/target = input("Area to teleport to", "Teleport to a location") as null|anything in SSmapping.ghostteleportlocs
var/area/A = SSmapping.teleportlocs[target]
teleport(A)
var/datum/async_input/A = input_autocomplete_async(usr, "Area to jump to: ", SSmapping.ghostteleportlocs)
A.on_close(CALLBACK(src, .proc/teleport))
/mob/dead/observer/proc/teleport(area/thearea)
if(!thearea || !isobserver(usr))
/mob/dead/observer/proc/teleport(area/A)
if(!A || !isobserver(usr))
return
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
L += T
var/list/turfs = list()
for(var/turf/T in get_area_turfs(A.type))
turfs += T
if(!L || !L.len)
to_chat(usr, "<span class='warning'>No area available.</span>")
if(!length(turfs))
to_chat(src, "<span class='warning'>Nowhere to jump to!</span>")
return
forceMove(pick(L))
forceMove(pick(turfs))
update_parallax_contents()
/mob/dead/observer/verb/follow()