Skip to content

Commit

Permalink
Fix visible emotes while blind
Browse files Browse the repository at this point in the history
  • Loading branch information
Cooeen committed Sep 7, 2024
1 parent 9ec1576 commit 0c17fcf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/datums/brain_damage/phobia.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
..()
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return
if(is_blind(owner))
if(owner.is_blind())
return
if(world.time > next_check && world.time > next_scare)
next_check = world.time + 50
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ GLOBAL_VAR_INIT(mobids, 1)
if(!msg)
continue

if(visible_message_flags & EMOTE_MESSAGE)
if(visible_message_flags & EMOTE_MESSAGE && !M.is_blind())
M.create_chat_message(src, raw_message = raw_msg, runechat_flags = visible_message_flags)

M.show_message(msg, MSG_VISUAL, blind_message, MSG_AUDIBLE)
Expand Down Expand Up @@ -250,7 +250,7 @@ GLOBAL_VAR_INIT(mobids, 1)
if(audible_message_flags & EMOTE_MESSAGE)
message = "<b>[src]</b> [message]"
for(var/mob/M in hearers)
if(audible_message_flags & EMOTE_MESSAGE)
if(audible_message_flags & EMOTE_MESSAGE && M.can_hear())
M.create_chat_message(src, raw_message = raw_msg, runechat_flags = audible_message_flags)
M.show_message(message, MSG_AUDIBLE, deaf_message, MSG_VISUAL)

Expand Down Expand Up @@ -443,7 +443,7 @@ GLOBAL_VAR_INIT(mobids, 1)
// shift-click catcher may issue examinate() calls for out-of-sight turfs
return

if(is_blind(src))
if(is_blind())
to_chat(src, span_warning("Something is there but I can't see it!"))
return

Expand Down
10 changes: 3 additions & 7 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,9 @@
aimheight = 1

///Checks if passed through item is blind
/proc/is_blind(A)
if(ismob(A))
var/mob/B = A
if(HAS_TRAIT(B, TRAIT_BLIND))
return TRUE
return B.eye_blind
return FALSE
/mob/proc/is_blind(A)
SHOULD_BE_PURE(TRUE)
return eye_blind ? TRUE : HAS_TRAIT(src, TRAIT_BLIND)

///Is the mob hallucinating?
/mob/proc/hallucinating()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
if(mailer)
return ..()

if(is_blind(user))
if(user.is_blind())
return ..()

if(istype(P, /obj/item/pen) || istype(P, /obj/item/natural/thorn)|| istype(P, /obj/item/natural/feather))
Expand Down

0 comments on commit 0c17fcf

Please sign in to comment.