Cryopod naming fixes.

Fixes issue where the cryopod name would not update if left willingly.
Fixes issue where the cryopod name would not update if forced inside.
This commit is contained in:
PsiOmega
2015-03-19 20:10:51 +01:00
parent 45971dfcc1
commit 44c8b03fcd

View File

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