fix visible messages and visibility (#8203)

This commit is contained in:
Cadyn
2024-04-09 22:38:28 -07:00
committed by GitHub
parent fa795ed704
commit 646798a1a6
2 changed files with 12 additions and 4 deletions

View File

@@ -18,8 +18,6 @@
UnregisterSignal(SSdcs, COMSIG_VISIBLE_MESSAGE)
/datum/component/hearer/proc/on_message(var/dcs,var/atom/source, var/message, var/blind_message, var/list/exclude_mobs, var/range, var/runemessage = "<span style='font-size: 1.5em'>👁</span>", var/inbelly)
if(!AreConnectedZLevels(source.z,parent_atom.z))
return
if(inbelly && !(parent_atom.loc == source.loc))
return
if(parent_atom in exclude_mobs)
@@ -31,6 +29,9 @@
if(!istype(source_turf) || !istype(parent_turf))
return
if(!AreConnectedZLevels(source_turf.z,parent_turf.z))
return
//Most expensive checks last
if(get_dist(source_turf,parent_turf) > range)
return
@@ -57,7 +58,14 @@
if(curturf.z != parent_turf.z)
return
else
//mmm vision flags
var/flags_any = SEE_THRU
flags_any |= (isturf(source) * SEE_TURFS) | (ismob(source) * SEE_MOBS) | (isobj(source) * SEE_OBJS) //speedy boys don't branch
var/mob/M = parent_atom
if(!istype(M) || !(flags_any & M.sight)) //If we're a mob and we have the correct vision flags we will see the source through walls anyways
if(!can_see(source, parent_atom, length = range * 2)) //Length is 2 * range because diagonals are funny with can_see
return //no can see, fuck off
if(ismob(parent_atom))
var/mob/M = parent_atom

View File

@@ -4664,6 +4664,7 @@
#include "modular_chomp\code\datums\changelog\changelog.dm"
#include "modular_chomp\code\datums\components\dry.dm"
#include "modular_chomp\code\datums\components\gargoyle.dm"
#include "modular_chomp\code\datums\components\hearer.dm"
#include "modular_chomp\code\datums\components\orbiter.dm"
#include "modular_chomp\code\datums\components\squeak.dm"
#include "modular_chomp\code\datums\components\xenoqueen.dm"
@@ -4745,7 +4746,6 @@
#include "modular_chomp\code\modules\artifice\deadringer.dm"
#include "modular_chomp\code\modules\balloon_alert\balloon_alert.dm"
#include "modular_chomp\code\modules\casino\casino_map_atoms.dm"
#include "modular_chomp\code\modules\client\hearable.dm"
#include "modular_chomp\code\modules\client\preferences.dm"
#include "modular_chomp\code\modules\client\preferences_spawnpoints.dm"
#include "modular_chomp\code\modules\client\preference_setup\global\setting_datums.dm"