Skip to content

Commit

Permalink
ghost bar members are now cleared more hastily (#25354)
Browse files Browse the repository at this point in the history
* ghost bar members are now cleared more hastily

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Luc <[email protected]>
Signed-off-by: GDN <[email protected]>

* Update code/modules/ruins/ghost_bar.dm

Signed-off-by: GDN <[email protected]>

* Update code/modules/ruins/ghost_bar.dm

Signed-off-by: DGamerL <[email protected]>

---------

Signed-off-by: GDN <[email protected]>
Signed-off-by: DGamerL <[email protected]>
Co-authored-by: Luc <[email protected]>
Co-authored-by: DGamerL <[email protected]>
  • Loading branch information
3 people authored May 11, 2024
1 parent 211e41e commit a0e6652
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/modules/ruins/ghost_bar.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GLOBAL_LIST_EMPTY(occupants_by_key)

/obj/effect/mob_spawn/human/alive/ghost_bar
name = "ghastly rejuvenator"
mob_name = "ghost bar occupant"
Expand Down Expand Up @@ -83,13 +85,22 @@
implant.insert(H)
log_game("[ckey] has entered the ghost bar")
playsound(src, 'sound/machines/wooden_closet_open.ogg', 50)
var/mob/old_mob = GLOB.occupants_by_key["[H.ckey]"]
if(old_mob)
qdel(old_mob)
GLOB.occupants_by_key["[H.ckey]"] = H
RegisterSignal(H, COMSIG_PARENT_QDELETING, PROC_REF(clear_references_to_owner))

/obj/effect/mob_spawn/human/alive/ghost_bar/proc/equip_item(mob/living/carbon/human/H, path, slot)
var/obj/item/I = new path(H)
H.equip_or_collect(I, slot, TRUE)
H.speaks_ooc = TRUE
return I

/obj/effect/mob_spawn/human/alive/ghost_bar/proc/clear_references_to_owner(mob/mob_to_obliterate)
SIGNAL_HANDLER // COMSIG_PARENT_QDELETING
GLOB.occupants_by_key -= mob_to_obliterate.ckey

/obj/structure/ghost_bar_cryopod
name = "returning sarcophagus"
desc = "Returns you back to the world of the dead."
Expand Down

0 comments on commit a0e6652

Please sign in to comment.