ok
This commit is contained in:
+79
-26
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user