Files
Bubberstation/code/modules/mob/dead/observer/logout.dm
vuonojenmustaturska f2ed477232 [READY] playsound performance (#40045)
tl;dr: we have lists of playermobs on the z-level, which generally have fewer player mobs to iterate through. If we use them, we can get rid of the z-level checks too. On the off-chance that something plays a sound in nullspace, we can skip pretty much everything. The client-check can go too, there are no playermobs without a client.
2018-09-08 13:27:01 +12:00

17 lines
448 B
Plaintext

/mob/dead/observer/Logout()
update_z(null)
if (client)
client.images -= (GLOB.ghost_images_default+GLOB.ghost_images_simple)
if(observetarget)
if(ismob(observetarget))
var/mob/target = observetarget
if(target.observers)
target.observers -= src
UNSETEMPTY(target.observers)
observetarget = null
..()
spawn(0)
if(src && !key) //we've transferred to another mob. This ghost should be deleted.
qdel(src)