[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.
This commit is contained in:
vuonojenmustaturska
2018-09-08 13:27:01 +12:00
committed by oranges
parent 3585ff1560
commit f2ed477232
8 changed files with 53 additions and 14 deletions
+4
View File
@@ -12,5 +12,9 @@
preferred_form = client.prefs.ghost_form
ghost_orbit = client.prefs.ghost_orbit
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
update_icon(preferred_form)
updateghostimages()
+1
View File
@@ -1,4 +1,5 @@
/mob/dead/observer/Logout()
update_z(null)
if (client)
client.images -= (GLOB.ghost_images_default+GLOB.ghost_images_simple)