From 770e9eca4e88010548ba6518e322a4535ba8fb6c Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:15:02 -0700 Subject: [PATCH 1/9] Update game.dm --- code/__HELPERS/game.dm | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index ca4b913369..ae9787243b 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -240,6 +240,12 @@ /proc/get_hearers_in_view(R, atom/source) + . = get_hearers_in_view_old(R, source) + . = get_hearers_in_view_new(R, source) + . = get_hearers_in_view_new_new(R, source) + . = get_hearers_in_view_new_new_new(R, source) + +/proc/get_hearers_in_view_old(R, atom/source) // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. var/turf/T = get_turf(source) . = list() @@ -268,6 +274,76 @@ processing_list.Cut(1, 2) processing_list += A.contents +/proc/get_hearers_in_view_new(R, atom/source) + var/turf/T = get_turf(source) + if(!T) + return + . = list() + var/list/processing = list() + if(R == 0) + processing += T.contents + else + var/lum = T.luminosity + T.luminosity = 6 + var/list/cachedview = view(R, T) + for(var/mob/M in cachedview) + processing_list += M + for(var/obj/O in cachedview) + processing_list += O + T.luminosity = lum + var/i = 1 + while(i < length(processing_list)) + var/atom/A = processing_list[i] + if(A.flags_1 & HEAR_1) + . += A + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) + processing_list += A.contents + +/proc/get_hearers_in_view_new_new(R, atom/source) + var/turf/T = get_turf(source) + if(!T) + return + . = list() + var/list/processing = list() + if(R == 0) + processing += T.contents + else + var/lum = T.luminosity + T.luminosity = 6 + for(var/mob/M in view(R, T)) + processing_list += M + for(var/obj/O in view(R, T)) + processing_list += O + T.luminosity = lum + var/i = 1 + while(i < length(processing_list)) + var/atom/A = processing_list[i] + if(A.flags_1 & HEAR_1) + . += A + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) + processing_list += A.contents + +/proc/get_hearers_in_view_new_new_new(R, atom/source) + var/turf/T = get_turf(source) + if(!T) + return + . = list() + var/list/processing = list() + if(R == 0) + processing += T.contents + else + var/lum = T.luminosity + T.luminosity = 6 + processing_list = view(R, T) + T.luminosity = lum + var/i = 1 + while(i < length(processing_list)) + var/atom/A = processing_list[i] + if(A.flags_1 & HEAR_1) + . += A + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) + processing_list += A.contents + /proc/get_mobs_in_radio_ranges(list/obj/item/radio/radios) . = list() // Returns a list of mobs who can hear any of the radios given in @radios From 2e49513439272b6ea94b76611b1e92e90f23383d Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:29:41 -0700 Subject: [PATCH 2/9] ok --- code/__HELPERS/game.dm | 105 +++++++++++++++++++++++++++++++---------- 1 file changed, 79 insertions(+), 26 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index ae9787243b..f4c97aa99d 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -253,26 +253,79 @@ if(!T) return - var/list/processing_list = list() + var/list/processing = list() if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view - processing_list += T.contents // We can shave off one iteration by assuming turfs cannot hear + processing += T.contents // We can shave off one iteration by assuming turfs cannot hear 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 var/list/cachedview = view(R, T) for(var/mob/M in cachedview) - processing_list += M + processing += M for(var/obj/O in cachedview) - processing_list += O + processing += O T.luminosity = lum - while(processing_list.len) // recursive_hear_check inlined here - var/atom/A = processing_list[1] + while(processing.len) // recursive_hear_check inlined here + var/atom/A = processing[1] if(A.flags_1 & HEAR_1) . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) - processing_list.Cut(1, 2) - processing_list += A.contents + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) + processing.Cut(1, 2) + processing += A.contents + +/proc/get_hearers_in_view_old_new(R, atom/source) + // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. + var/turf/T = get_turf(source) + . = list() + + if(!T) + return + + var/list/processing = list() + if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view + processing += T.contents // We can shave off one iteration by assuming turfs cannot hear + 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)) + processing += M + for(var/obj/O in view(R, T)) + processing += O + T.luminosity = lum + + while(processing.len) // recursive_hear_check inlined here + var/atom/A = processing[1] + if(A.flags_1 & HEAR_1) + . += A + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) + processing.Cut(1, 2) + processing += A.contents + +/proc/get_hearers_in_view_old_new_new(R, atom/source) + // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. + var/turf/T = get_turf(source) + . = list() + + if(!T) + return + + var/list/processing = list() + if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view + processing += T.contents // We can shave off one iteration by assuming turfs cannot hear + 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 + processing = view(R, T) + T.luminosity = lum + + while(processing.len) // recursive_hear_check inlined here + var/atom/A = processing[1] + if(A.flags_1 & HEAR_1) + . += A + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) + processing.Cut(1, 2) + processing += A.contents /proc/get_hearers_in_view_new(R, atom/source) var/turf/T = get_turf(source) @@ -287,17 +340,17 @@ T.luminosity = 6 var/list/cachedview = view(R, T) for(var/mob/M in cachedview) - processing_list += M + processing += M for(var/obj/O in cachedview) - processing_list += O + processing += O T.luminosity = lum var/i = 1 - while(i < length(processing_list)) - var/atom/A = processing_list[i] + while(i < length(processing)) + var/atom/A = processing[i] if(A.flags_1 & HEAR_1) . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) - processing_list += A.contents + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) + processing += A.contents /proc/get_hearers_in_view_new_new(R, atom/source) var/turf/T = get_turf(source) @@ -311,17 +364,17 @@ var/lum = T.luminosity T.luminosity = 6 for(var/mob/M in view(R, T)) - processing_list += M + processing += M for(var/obj/O in view(R, T)) - processing_list += O + processing += O T.luminosity = lum var/i = 1 - while(i < length(processing_list)) - var/atom/A = processing_list[i] + while(i < length(processing)) + var/atom/A = processing[i] if(A.flags_1 & HEAR_1) . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) - processing_list += A.contents + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) + processing += A.contents /proc/get_hearers_in_view_new_new_new(R, atom/source) var/turf/T = get_turf(source) @@ -334,15 +387,15 @@ else var/lum = T.luminosity T.luminosity = 6 - processing_list = view(R, T) + processing = view(R, T) T.luminosity = lum var/i = 1 - while(i < length(processing_list)) - var/atom/A = processing_list[i] + while(i < length(processing)) + var/atom/A = processing[i] if(A.flags_1 & HEAR_1) . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .) - processing_list += A.contents + SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) + processing += A.contents /proc/get_mobs_in_radio_ranges(list/obj/item/radio/radios) . = list() From 970f6f54ad1f35bb894f601816ff72e579d9f6c1 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 03:17:42 -0700 Subject: [PATCH 3/9] ok --- code/__HELPERS/game.dm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index f4c97aa99d..7896c189d8 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -241,6 +241,8 @@ /proc/get_hearers_in_view(R, atom/source) . = get_hearers_in_view_old(R, source) + . = get_hearers_in_view_old_new(R, source) + . = get_hearers_in_view_old_new_new(R, source) . = get_hearers_in_view_new(R, source) . = get_hearers_in_view_new_new(R, source) . = get_hearers_in_view_new_new_new(R, source) @@ -316,7 +318,8 @@ 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 - processing = view(R, T) + for(var/turf/T2 in view(R, T)) + processing += T2 T.luminosity = lum while(processing.len) // recursive_hear_check inlined here @@ -346,7 +349,7 @@ T.luminosity = lum var/i = 1 while(i < length(processing)) - var/atom/A = processing[i] + var/atom/A = processing[i++] if(A.flags_1 & HEAR_1) . += A SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) @@ -370,7 +373,7 @@ T.luminosity = lum var/i = 1 while(i < length(processing)) - var/atom/A = processing[i] + var/atom/A = processing[i++] if(A.flags_1 & HEAR_1) . += A SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) @@ -387,11 +390,12 @@ else var/lum = T.luminosity T.luminosity = 6 - processing = view(R, T) + for(var/turf/T2 in view(R, T)) + processing += T2 T.luminosity = lum var/i = 1 while(i < length(processing)) - var/atom/A = processing[i] + var/atom/A = processing[i++] if(A.flags_1 & HEAR_1) . += A SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) From 8816a8b3e4fd33f6274561cd0b2ddbb5f9629cff Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 03:34:53 -0700 Subject: [PATCH 4/9] i did a thing yay me --- code/__HELPERS/game.dm | 145 +------------------------------------ code/__HELPERS/unsorted.dm | 31 ++++---- 2 files changed, 18 insertions(+), 158 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 7896c189d8..1ea418a773 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -152,11 +152,11 @@ /proc/recursive_hear_check(O) var/list/processing_list = list(O) . = list() - while(processing_list.len) - var/atom/A = processing_list[1] + var/i = 1 + while(i < length(processing_list)) + var/atom/A = processing_list[i++] if(A.flags_1 & HEAR_1) . += A - processing_list.Cut(1, 2) processing_list += A.contents /** recursive_organ_check @@ -238,124 +238,7 @@ return found_mobs - /proc/get_hearers_in_view(R, atom/source) - . = get_hearers_in_view_old(R, source) - . = get_hearers_in_view_old_new(R, source) - . = get_hearers_in_view_old_new_new(R, source) - . = get_hearers_in_view_new(R, source) - . = get_hearers_in_view_new_new(R, source) - . = get_hearers_in_view_new_new_new(R, source) - -/proc/get_hearers_in_view_old(R, atom/source) - // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. - var/turf/T = get_turf(source) - . = list() - - if(!T) - return - - var/list/processing = list() - if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view - processing += T.contents // We can shave off one iteration by assuming turfs cannot hear - 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 - var/list/cachedview = view(R, T) - for(var/mob/M in cachedview) - processing += M - for(var/obj/O in cachedview) - processing += O - T.luminosity = lum - - while(processing.len) // recursive_hear_check inlined here - var/atom/A = processing[1] - if(A.flags_1 & HEAR_1) - . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) - processing.Cut(1, 2) - processing += A.contents - -/proc/get_hearers_in_view_old_new(R, atom/source) - // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. - var/turf/T = get_turf(source) - . = list() - - if(!T) - return - - var/list/processing = list() - if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view - processing += T.contents // We can shave off one iteration by assuming turfs cannot hear - 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)) - processing += M - for(var/obj/O in view(R, T)) - processing += O - T.luminosity = lum - - while(processing.len) // recursive_hear_check inlined here - var/atom/A = processing[1] - if(A.flags_1 & HEAR_1) - . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) - processing.Cut(1, 2) - processing += A.contents - -/proc/get_hearers_in_view_old_new_new(R, atom/source) - // Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode. - var/turf/T = get_turf(source) - . = list() - - if(!T) - return - - var/list/processing = list() - if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view - processing += T.contents // We can shave off one iteration by assuming turfs cannot hear - 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/turf/T2 in view(R, T)) - processing += T2 - T.luminosity = lum - - while(processing.len) // recursive_hear_check inlined here - var/atom/A = processing[1] - if(A.flags_1 & HEAR_1) - . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) - processing.Cut(1, 2) - processing += A.contents - -/proc/get_hearers_in_view_new(R, atom/source) - var/turf/T = get_turf(source) - if(!T) - return - . = list() - var/list/processing = list() - if(R == 0) - processing += T.contents - else - var/lum = T.luminosity - T.luminosity = 6 - var/list/cachedview = view(R, T) - for(var/mob/M in cachedview) - processing += M - for(var/obj/O in cachedview) - processing += O - T.luminosity = lum - var/i = 1 - while(i < length(processing)) - var/atom/A = processing[i++] - if(A.flags_1 & HEAR_1) - . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) - processing += A.contents - -/proc/get_hearers_in_view_new_new(R, atom/source) var/turf/T = get_turf(source) if(!T) return @@ -379,28 +262,6 @@ SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) processing += A.contents -/proc/get_hearers_in_view_new_new_new(R, atom/source) - var/turf/T = get_turf(source) - if(!T) - return - . = list() - var/list/processing = list() - if(R == 0) - processing += T.contents - else - var/lum = T.luminosity - T.luminosity = 6 - for(var/turf/T2 in view(R, T)) - processing += T2 - T.luminosity = lum - var/i = 1 - while(i < length(processing)) - var/atom/A = processing[i++] - if(A.flags_1 & HEAR_1) - . += A - SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) - processing += A.contents - /proc/get_mobs_in_radio_ranges(list/obj/item/radio/radios) . = list() // Returns a list of mobs who can hear any of the radios given in @radios diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index e916b2532a..35f37eeac3 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -457,36 +457,35 @@ Turf and target are separate in case you want to teleport some distance from a t /atom/proc/GetAllContents(var/T) var/list/processing_list = list(src) - var/list/assembled = list() if(T) - while(processing_list.len) - var/atom/A = processing_list[1] - processing_list.Cut(1, 2) + . = list() + var/i = 1 + while(i < length(processing_list)) + var/atom/A = processing_list[i++] //Byond does not allow things to be in multiple contents, or double parent-child hierarchies, so only += is needed //This is also why we don't need to check against assembled as we go along processing_list += A.contents if(istype(A,T)) - assembled += A + . += A else - while(processing_list.len) - var/atom/A = processing_list[1] - processing_list.Cut(1, 2) + var/i = 1 + while(i < length(processing_list)) + var/atom/A = processing_list[i++] processing_list += A.contents - assembled += A - return assembled + return processing_list /atom/proc/GetAllContentsIgnoring(list/ignore_typecache) if(!length(ignore_typecache)) return GetAllContents() var/list/processing = list(src) - var/list/assembled = list() - while(processing.len) - var/atom/A = processing[1] - processing.Cut(1,2) + . = list() + var/i = 1 + while(i < length(processing)) + var/atom/A = processing[i++] if(!ignore_typecache[A.type]) processing += A.contents - assembled += A - return assembled + . += A + //Step-towards method of determining whether one atom can see another. Similar to viewers() /proc/can_see(atom/source, atom/target, length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate. From ea43724fc5623d0a98715a42b49b7c0ef5c0dad6 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 04:45:53 -0700 Subject: [PATCH 5/9] Update game.dm --- code/__HELPERS/game.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 1ea418a773..677b15bae5 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -240,9 +240,9 @@ /proc/get_hearers_in_view(R, atom/source) var/turf/T = get_turf(source) + . = list() if(!T) return - . = list() var/list/processing = list() if(R == 0) processing += T.contents From d837cf1fd0a5343c1c1df8821f54fa03d302a9bd Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 15:57:48 -0700 Subject: [PATCH 6/9] Update game.dm --- code/__HELPERS/game.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 677b15bae5..5660d0ab05 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -152,9 +152,9 @@ /proc/recursive_hear_check(O) var/list/processing_list = list(O) . = list() - var/i = 1 + var/i = 0 while(i < length(processing_list)) - var/atom/A = processing_list[i++] + var/atom/A = processing_list[++i] if(A.flags_1 & HEAR_1) . += A processing_list += A.contents @@ -254,9 +254,9 @@ for(var/obj/O in view(R, T)) processing += O T.luminosity = lum - var/i = 1 + var/i = 0 while(i < length(processing)) - var/atom/A = processing[i++] + var/atom/A = processing[++i] if(A.flags_1 & HEAR_1) . += A SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .) From e6e3763705af97ff4dd5a0a9f596d25af151c009 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 15:59:09 -0700 Subject: [PATCH 7/9] Update game.dm --- code/__HELPERS/game.dm | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 5660d0ab05..f753ca46d0 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -145,20 +145,6 @@ turfs += T return turfs - -//This is the new version of recursive_mob_check, used for say(). -//The other proc was left intact because morgue trays use it. -//Sped this up again for real this time -/proc/recursive_hear_check(O) - var/list/processing_list = list(O) - . = list() - var/i = 0 - while(i < length(processing_list)) - var/atom/A = processing_list[++i] - if(A.flags_1 & HEAR_1) - . += A - processing_list += A.contents - /** recursive_organ_check * inputs: O (object to start with) * outputs: From 8f8b6cc4bdf6a7a01b4aad56006e0a9ef88288f8 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 15:59:54 -0700 Subject: [PATCH 8/9] Update unsorted.dm --- code/__HELPERS/unsorted.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 35f37eeac3..3850dd4338 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -459,18 +459,18 @@ Turf and target are separate in case you want to teleport some distance from a t var/list/processing_list = list(src) if(T) . = list() - var/i = 1 + var/i = 0 while(i < length(processing_list)) - var/atom/A = processing_list[i++] + var/atom/A = processing_list[++i] //Byond does not allow things to be in multiple contents, or double parent-child hierarchies, so only += is needed //This is also why we don't need to check against assembled as we go along processing_list += A.contents if(istype(A,T)) . += A else - var/i = 1 + var/i = 0 while(i < length(processing_list)) - var/atom/A = processing_list[i++] + var/atom/A = processing_list[++i] processing_list += A.contents return processing_list @@ -479,9 +479,9 @@ Turf and target are separate in case you want to teleport some distance from a t return GetAllContents() var/list/processing = list(src) . = list() - var/i = 1 + var/i = 0 while(i < length(processing)) - var/atom/A = processing[i++] + var/atom/A = processing[++i] if(!ignore_typecache[A.type]) processing += A.contents . += A From 3ccf7bcced67ba00c975b903ff5d1675ba9784ad Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 16:02:40 -0700 Subject: [PATCH 9/9] Update game.dm --- code/__HELPERS/game.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index f753ca46d0..72e801fb1a 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -235,9 +235,10 @@ else var/lum = T.luminosity T.luminosity = 6 - for(var/mob/M in view(R, T)) + var/list/cached_view = view(R, T) + for(var/mob/M in cached_view) processing += M - for(var/obj/O in view(R, T)) + for(var/obj/O in cached_view) processing += O T.luminosity = lum var/i = 0