mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +01:00
Merge pull request #1647 from VOREStation/aro-gmo
Fixes subtle from inside objects, brains, dogborgs
This commit is contained in:
+16
-14
@@ -271,20 +271,22 @@
|
||||
var/list/hear = dview(range,T,INVISIBILITY_MAXIMUM)
|
||||
var/list/hearturfs = list()
|
||||
|
||||
for(var/atom/movable/AM in hear)
|
||||
if(ismob(AM))
|
||||
mobs += AM
|
||||
hearturfs += AM.locs[1]
|
||||
else if(isobj(AM))
|
||||
objs += AM
|
||||
hearturfs += AM.locs[1]
|
||||
for(var/thing in hear)
|
||||
if(istype(thing,/obj))
|
||||
objs += thing
|
||||
hearturfs += get_turf(thing)
|
||||
else if(istype(thing,/mob))
|
||||
mobs += thing
|
||||
hearturfs += get_turf(thing)
|
||||
|
||||
//A list of every mob with a client
|
||||
for(var/mob/M in player_list)
|
||||
if(M.loc && M.locs[1] in hearturfs)
|
||||
mobs |= M
|
||||
for(var/mob in player_list)
|
||||
if(get_turf(mob) in hearturfs)
|
||||
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)
|
||||
if(1) //Audio messages use ghost_ears
|
||||
if(M.is_preference_enabled(/datum/client_preference/ghost_ears))
|
||||
@@ -294,9 +296,9 @@
|
||||
mobs |= M
|
||||
|
||||
//For objects below the top level who still want to hear
|
||||
for(var/obj/O in listening_objects)
|
||||
if(O.loc && O.locs[1] in hearturfs)
|
||||
objs |= O
|
||||
for(var/obj in listening_objects)
|
||||
if(get_turf(obj) in hearturfs)
|
||||
objs |= obj
|
||||
|
||||
return list("mobs" = mobs, "objs" = objs)
|
||||
|
||||
|
||||
@@ -34,11 +34,14 @@
|
||||
var/list/m_viewers = in_range["mobs"]
|
||||
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.
|
||||
if(M)
|
||||
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)
|
||||
if(O)
|
||||
O.see_emote(src, message, m_type)
|
||||
|
||||
+14
-23
@@ -12,6 +12,8 @@
|
||||
return
|
||||
|
||||
message = sanitize(message)
|
||||
if(!message)
|
||||
return
|
||||
|
||||
set_typing_indicator(0)
|
||||
if(use_me)
|
||||
@@ -19,8 +21,6 @@
|
||||
else
|
||||
usr.emote_vr(message)
|
||||
|
||||
|
||||
|
||||
/mob/proc/custom_emote_vr(var/m_type=1,var/message = null) //This would normally go in emote.dm
|
||||
if(stat || !use_me && usr == src)
|
||||
src << "You are unable to emote."
|
||||
@@ -40,32 +40,23 @@
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
if (message)
|
||||
log_emote("[name]/[key] : [message]")
|
||||
|
||||
for(var/mob/M in player_list)
|
||||
if (!M.client)
|
||||
continue //skip monkeys and leavers
|
||||
if (istype(M, /mob/new_player))
|
||||
continue
|
||||
if(findtext(message," snores.")) //Because we have so many sleeping people.
|
||||
break
|
||||
if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_sight) && !(M in viewers(src,null)))
|
||||
M.show_message(message, m_type)
|
||||
var/list/subtle = get_mobs_or_objects_in_view(1,src)
|
||||
for(var/I in subtle)
|
||||
if(isobj(I))
|
||||
spawn(0)
|
||||
if(I) //It's possible that it could be deleted in the meantime.
|
||||
var/obj/O = I
|
||||
O.see_emote(src, message, 2)
|
||||
else if(ismob(I))
|
||||
var/mob/M = I
|
||||
var/list/vis = get_mobs_and_objs_in_view_fast(get_turf(src),1,2) //Turf, Range, and type 2 is emote
|
||||
var/list/vis_mobs = vis["mobs"]
|
||||
var/list/vis_objs = vis["objs"]
|
||||
|
||||
for(var/vismob in vis_mobs)
|
||||
var/mob/M = vismob
|
||||
spawn(0)
|
||||
M.show_message(message, 2)
|
||||
|
||||
|
||||
for(var/visobj in vis_objs)
|
||||
var/obj/O = visobj
|
||||
spawn(0)
|
||||
O.see_emote(src, message, 2)
|
||||
|
||||
/mob/proc/emote_vr(var/act, var/type, var/message) //This would normally go in say.dm
|
||||
if(act == "me")
|
||||
return custom_emote_vr(type, message)
|
||||
return custom_emote_vr(type, message)
|
||||
|
||||
Reference in New Issue
Block a user