Renamed get_mobs_in_view to get_listeners_in_view.

This commit is contained in:
ESwordTheCat
2014-04-23 15:55:12 +08:00
parent 14994594a6
commit d96df8b22d
4 changed files with 12 additions and 11 deletions

View File

@@ -166,12 +166,13 @@
return L return L
// The old system would loop through lists for a total of 5000 per function call, in an empty server. /**
// This new system will loop at around 1000 in an empty server. * Returns a list of moveable atoms in range of R from source. Used in radio and say code.
*
/proc/get_mobs_in_view(var/R, var/atom/source) * The old system would loop through lists for a total of 5000 per function call, in an empty server.
// Returns a list of mobs in range of R from source. Used in radio and say code. * This new system will loop at around 1000 in an empty server.
*/
/proc/get_listeners_in_view(var/R, var/atom/source)
var/turf/T = get_turf(source) var/turf/T = get_turf(source)
var/list/hear = list() var/list/hear = list()

View File

@@ -668,7 +668,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
var/range = receive_range(freq, level) var/range = receive_range(freq, level)
if(range > -1) if(range > -1)
return get_mobs_in_view(canhear_range, src) return get_listeners_in_view(canhear_range, src)
/obj/item/device/radio/examine() /obj/item/device/radio/examine()

View File

@@ -131,10 +131,10 @@ var/global/normal_ooc_colour = "#002eb8"
var/list/heard var/list/heard
var/mob/living/silicon/ai/AI var/mob/living/silicon/ai/AI
if(!isAI(src.mob)) if(!isAI(src.mob))
heard = get_mobs_in_view(7, src.mob) heard = get_listeners_in_view(7, src.mob)
else else
AI = src.mob AI = src.mob
heard = get_mobs_in_view(7, (istype(AI.eyeobj) ? AI.eyeobj : AI)) //if it doesn't have an eye somehow give it just the AI mob itself heard = get_listeners_in_view(7, (istype(AI.eyeobj) ? AI.eyeobj : AI)) //if it doesn't have an eye somehow give it just the AI mob itself
for(var/mob/M in heard) for(var/mob/M in heard)
if(AI == M) continue if(AI == M) continue
if(!M.client) if(!M.client)

View File

@@ -467,8 +467,8 @@ var/list/department_radio_keys = list(
var/list/listening var/list/listening
listening = get_mobs_in_view(message_range, src) listening = get_listeners_in_view(message_range, src)
//var/list/onscreen = get_mobs_in_view(7, src) //var/list/onscreen = get_listeners_in_view(7, src)
for(var/mob/M in player_list) for(var/mob/M in player_list)
if (!M.client) if (!M.client)
continue //skip monkeys and leavers continue //skip monkeys and leavers