mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-23 23:54:45 +00:00
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.
17 lines
448 B
Plaintext
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)
|