Optimizes get_hearers_in_view by caching the results of view()

This commit is contained in:
deathride58
2019-03-30 23:44:56 -04:00
parent d763eec341
commit 627f725958
+3 -2
View File
@@ -221,9 +221,10 @@
else // A variation of get_hear inlined here to take advantage of the compiler's fastpath for obj/mob in view
var/lum = T.luminosity
T.luminosity = 6 // This is the maximum luminosity
for(var/mob/M in view(R, T))
var/list/cachedview = view(R, T)
for(var/mob/M in cachedview)
processing_list += M
for(var/obj/O in view(R, T))
for(var/obj/O in cachedview)
processing_list += O
T.luminosity = lum