diff --git a/code/datums/spawners_menu.dm b/code/datums/spawners_menu.dm index 68e1f48d981..09cf433daf5 100644 --- a/code/datums/spawners_menu.dm +++ b/code/datums/spawners_menu.dm @@ -21,7 +21,7 @@ this["desc"] = "" this["uids"] = list() for(var/spawner_obj in GLOB.mob_spawners[spawner]) - this["uids"] += "[UID(spawner_obj)]" + this["uids"] += "\ref[spawner_obj]" if(!this["desc"]) if(istype(spawner_obj, /obj/effect/mob_spawn)) var/obj/effect/mob_spawn/MS = spawner_obj @@ -37,22 +37,16 @@ /datum/spawners_menu/Topic(href, href_list) if(..()) return 1 - //var/spawner_ref = pick(GLOB.mob_spawners[href_list["name"]]) - var/spawners = href_list["uid"] - spawners = replacetext(spawners, ",", ";") - to_chat(world, spawners) + var/spawners = replacetext(href_list["uid"], ",", ";") var/list/possible_spawners = params2list(spawners) - var/obj/effect/mob_spawn/MS = locateUID(pick(possible_spawners)) - if(!MS) + var/obj/effect/mob_spawn/MS = locate(pick(possible_spawners)) + if(!MS || !istype(MS)) + log_runtime(EXCEPTION("A ghost tried to interact with an invalid spawner, or the spawner didn't exist.")) return - to_chat(world,"ms passed!") switch(href_list["action"]) if("jump") - if(MS) - owner.forceMove(get_turf(MS)) - . = TRUE + owner.forceMove(get_turf(MS)) + . = TRUE if("spawn") - if(MS) - MS.attack_ghost(owner) - . = TRUE - to_chat(world,"FUzxcCKKK") + MS.attack_ghost(owner) + . = TRUE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7a94bc40ed5..6a067a156ce 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -25,7 +25,6 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi var/ghostvision = 1 //is the ghost able to see things humans can't? var/seedarkness = 1 var/data_hud_seen = 0 //this should one of the defines in __DEFINES/hud.dm - var/datum/spawners_menu/spawners_menu /mob/dead/observer/New(var/mob/body=null, var/flags=1) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF @@ -98,7 +97,6 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi ghost_darkness_images -= ghostimage QDEL_NULL(ghostimage) updateallghostimages() - QDEL_NULL(spawners_menu) return ..() /mob/dead/CanPass(atom/movable/mover, turf/target, height=0) @@ -687,6 +685,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Mob spawners menu" set desc = "See all currently available ghost spawners" set category = "Ghost" - if(!spawners_menu) - spawners_menu = new(src) - spawners_menu.ui_interact(src) + + var/datum/spawners_menu/menu = new /datum/spawners_menu(src) + menu.ui_interact(src) diff --git a/nano/templates/spawners_menu.tmpl b/nano/templates/spawners_menu.tmpl index 3027158aa69..d1f8b3d7287 100644 --- a/nano/templates/spawners_menu.tmpl +++ b/nano/templates/spawners_menu.tmpl @@ -1,4 +1,5 @@
+

Mob Spawners

{{for data.spawners}}