mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Greases up get_blahblah_fast
Untypes lists, obj is more likely so it goes first, uses get_turf now that get_turf uses the get_step witchcraft method.
This commit is contained in:
@@ -271,20 +271,22 @@
|
|||||||
var/list/hear = dview(range,T,INVISIBILITY_MAXIMUM)
|
var/list/hear = dview(range,T,INVISIBILITY_MAXIMUM)
|
||||||
var/list/hearturfs = list()
|
var/list/hearturfs = list()
|
||||||
|
|
||||||
for(var/atom/movable/AM in hear)
|
for(var/thing in hear)
|
||||||
if(ismob(AM))
|
if(istype(thing,/obj))
|
||||||
mobs += AM
|
objs += thing
|
||||||
hearturfs += AM.locs[1]
|
hearturfs += get_turf(thing)
|
||||||
else if(isobj(AM))
|
else if(istype(thing,/mob))
|
||||||
objs += AM
|
mobs += thing
|
||||||
hearturfs += AM.locs[1]
|
hearturfs += get_turf(thing)
|
||||||
|
|
||||||
//A list of every mob with a client
|
//A list of every mob with a client
|
||||||
for(var/mob/M in player_list)
|
for(var/mob in player_list)
|
||||||
if(M.loc && M.locs[1] in hearturfs)
|
if(get_turf(mob) in hearturfs)
|
||||||
mobs |= M
|
mobs |= mob
|
||||||
|
continue
|
||||||
|
|
||||||
else if(M.stat == DEAD && !M.forbid_seeing_deadchat)
|
var/mob/M = mob
|
||||||
|
if(M.stat == DEAD && !M.forbid_seeing_deadchat)
|
||||||
switch(type)
|
switch(type)
|
||||||
if(1) //Audio messages use ghost_ears
|
if(1) //Audio messages use ghost_ears
|
||||||
if(M.is_preference_enabled(/datum/client_preference/ghost_ears))
|
if(M.is_preference_enabled(/datum/client_preference/ghost_ears))
|
||||||
@@ -294,9 +296,9 @@
|
|||||||
mobs |= M
|
mobs |= M
|
||||||
|
|
||||||
//For objects below the top level who still want to hear
|
//For objects below the top level who still want to hear
|
||||||
for(var/obj/O in listening_objects)
|
for(var/obj in listening_objects)
|
||||||
if(O.loc && O.locs[1] in hearturfs)
|
if(get_turf(obj) in hearturfs)
|
||||||
objs |= O
|
objs |= obj
|
||||||
|
|
||||||
return list("mobs" = mobs, "objs" = objs)
|
return list("mobs" = mobs, "objs" = objs)
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,14 @@
|
|||||||
var/list/m_viewers = in_range["mobs"]
|
var/list/m_viewers = in_range["mobs"]
|
||||||
var/list/o_viewers = in_range["objs"]
|
var/list/o_viewers = in_range["objs"]
|
||||||
|
|
||||||
for(var/mob/M in m_viewers)
|
for(var/mob in m_viewers)
|
||||||
|
var/mob/M = mob
|
||||||
spawn(0) // It's possible that it could be deleted in the meantime, or that it runtimes.
|
spawn(0) // It's possible that it could be deleted in the meantime, or that it runtimes.
|
||||||
if(M)
|
if(M)
|
||||||
M.show_message(message, m_type)
|
M.show_message(message, m_type)
|
||||||
for(var/obj/O in o_viewers)
|
|
||||||
|
for(var/obj in o_viewers)
|
||||||
|
var/obj/O = obj
|
||||||
spawn(0)
|
spawn(0)
|
||||||
if(O)
|
if(O)
|
||||||
O.see_emote(src, message, m_type)
|
O.see_emote(src, message, m_type)
|
||||||
|
|||||||
Reference in New Issue
Block a user