diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 5915aef5ac..29227ceb58 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -398,10 +398,9 @@
announce.autosay("[occupant.real_name] [on_store_message]", "[on_store_name]")
visible_message("\The [src] hums and hisses as it moves [occupant.real_name] into storage.", 3)
+ set_occupant(null)
// Delete the mob.
del(occupant)
- occupant = null
- name = initial(name)
/obj/machinery/cryopod/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
@@ -448,7 +447,7 @@
M << "[on_enter_occupant_message]"
M << "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round."
- occupant = M
+ set_occupant(M)
time_entered = world.time
// Book keeping!
@@ -517,7 +516,7 @@
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.loc = src
- src.occupant = usr
+ set_occupant(usr)
if(orient_right)
icon_state = "[occupied_icon_state]-r"
@@ -526,11 +525,10 @@
usr << "[on_enter_occupant_message]"
usr << "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round."
- occupant = usr
+
time_entered = world.time
src.add_fingerprint(usr)
- name = "[name] ([usr.name])"
return
@@ -544,7 +542,7 @@
occupant.client.perspective = MOB_PERSPECTIVE
occupant.loc = get_turf(src)
- occupant = null
+ set_occupant(null)
if(orient_right)
icon_state = "[base_icon_state]-r"
@@ -553,6 +551,12 @@
return
+/obj/machinery/cryopod/proc/set_occupant(var/occupant)
+ src.occupant = occupant
+ name = initial(name)
+ if(occupant)
+ name = "[name] ([occupant])]"
+
//Attacks/effects.
/obj/machinery/cryopod/blob_act()