Fixes morgue updating and removes VGhooks

This commit is contained in:
Krausus
2016-07-11 17:39:21 -04:00
parent 26e13f270f
commit 355fb3c080
12 changed files with 54 additions and 129 deletions
+19 -45
View File
@@ -449,50 +449,24 @@
to_chat(usr, "\red Access denied.")
return
/hook/Login/proc/update_morgue(var/client/client, var/mob/L)
//Update morgues on login/logout
if(L.stat == DEAD)
var/obj/structure/morgue/Morgue = null
var/mob/living/carbon/human/C = null
if(istype(L,/mob/dead/observer)) //We're a ghost, let's find our corpse
var/mob/dead/observer/G = L
if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control.
return
if(G.can_reenter_corpse && G.mind.current)
C = G.mind.current
else if(istype(L,/mob/living/carbon/human))
C = L
/mob/proc/update_morgue()
if(stat == DEAD)
var/obj/structure/morgue/morgue
var/mob/living/C = src
var/mob/dead/observer/G = src
if(istype(G) && G.can_reenter_corpse && G.mind) //We're a ghost, let's find our corpse
C = G.mind.current
if(istype(C)) //We found our corpse, is it inside a morgue?
morgue = get(C.loc, /obj/structure/morgue)
if(morgue)
morgue.update()
if(C) //We found our corpse, is it inside a morgue?
if(istype(C.loc,/obj/structure/morgue))
Morgue = C.loc
else if(istype(C.loc,/obj/structure/closet/body_bag))
var/obj/structure/closet/body_bag/B = C.loc
if(istype(B.loc,/obj/structure/morgue))
Morgue = B.loc
if(Morgue)
Morgue.update()
/hook/mob_login/proc/update_morgue(var/client/client, var/mob/mob)
//Update morgues on login
mob.update_morgue()
return 1
/hook/Logout/proc/update_morgue(var/client/client, var/mob/L)
//Update morgues on login/logout
if(L.stat == DEAD)
var/obj/structure/morgue/Morgue = null
var/mob/living/carbon/human/C = null
if(istype(L,/mob/dead/observer)) //We're a ghost, let's find our corpse
var/mob/dead/observer/G = L
if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control.
return 1
if(G.can_reenter_corpse && G.mind.current)
C = G.mind.current
else if(istype(L,/mob/living/carbon/human))
C = L
if(C) //We found our corpse, is it inside a morgue?
if(istype(C.loc,/obj/structure/morgue))
Morgue = C.loc
else if(istype(C.loc,/obj/structure/closet/body_bag))
var/obj/structure/closet/body_bag/B = C.loc
if(istype(B.loc,/obj/structure/morgue))
Morgue = B.loc
if(Morgue)
Morgue.update()
/hook/mob_logout/proc/update_morgue(var/client/client, var/mob/mob)
//Update morgues on logout
mob.update_morgue()
return 1