Skip to content

Commit

Permalink
bugfix: Can Hear Fix (#4137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottfrei authored Dec 28, 2023
1 parent 38e9749 commit cd16f0a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions code/modules/mob/living/carbon/human/species/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1156,11 +1156,11 @@ It'll return null if the organ doesn't correspond, so include null checks when u
var/datum/species/selected_species = GLOB.all_species[picked_species]
return species_name ? picked_species : selected_species.type

/datum/species/proc/can_hear(mob/living/carbon/human/H)
. = FALSE
var/obj/item/organ/internal/ears/ears = H.get_int_organ(/obj/item/organ/internal/ears)
if(istype(ears) && !HAS_TRAIT(H, TRAIT_DEAF))
. = TRUE

/datum/species/proc/can_hear(mob/living/carbon/human/user)
var/obj/item/organ/internal/ears/ears = user.get_organ_slot(INTERNAL_ORGAN_EARS)
return ears && !(DEAF in user.mutations) && !HAS_TRAIT(user, TRAIT_DEAF)


/datum/species/proc/spec_Process_Spacemove(mob/living/carbon/human/H)
return FALSE
Expand Down
7 changes: 3 additions & 4 deletions code/modules/mob/living/carbon/human/species/slime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@
..()


/datum/species/slime/can_hear(mob/living/carbon/human/H) // fucking snowflakes
. = FALSE
if(!HAS_TRAIT(H, TRAIT_DEAF))
. = TRUE
/datum/species/slime/can_hear(mob/living/carbon/human/user)
return !(DEAF in user.mutations) && !HAS_TRAIT(user, TRAIT_DEAF)


/datum/action/innate/slimecolor
name = "Toggle Recolor"
Expand Down
7 changes: 4 additions & 3 deletions code/modules/mob/living/carbon/human/update_stat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@


/mob/living/carbon/human/can_hear()
. = TRUE // Fallback if we don't have a species
if(dna.species)
. = dna.species.can_hear(src)
if(dna?.species)
return dna.species.can_hear(src)
return ..() // Fallback if we don't have a species or DNA


/mob/living/carbon/human/check_death_method()
return dna.species.dies_at_threshold
9 changes: 5 additions & 4 deletions code/modules/mob/living/carbon/update_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
update_canmove()

/mob/living/carbon/can_hear()
. = FALSE
var/obj/item/organ/internal/ears/ears = get_int_organ(/obj/item/organ/internal/ears)
if(istype(ears) && !HAS_TRAIT(src, TRAIT_DEAF))
. = TRUE
. = ..()
var/obj/item/organ/internal/ears/ears = get_organ_slot(INTERNAL_ORGAN_EARS)
if(!ears)
return FALSE

2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,4 @@

/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
/mob/living/silicon/can_hear()
. = TRUE
return TRUE
2 changes: 1 addition & 1 deletion code/modules/mob/living/update_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

// Whether the mob can hear things
/mob/living/can_hear()
. = !(DEAF in mutations) && !HAS_TRAIT(src, TRAIT_DEAF)
return !(DEAF in mutations) && !HAS_TRAIT(src, TRAIT_DEAF)

// Whether the mob is able to see
// `information_only` is for stuff that's purely informational - like blindness overlays
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -705,4 +705,4 @@

// No hearing announcements
/mob/new_player/can_hear()
return 0
return FALSE
2 changes: 1 addition & 1 deletion code/modules/mob/update_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// Procs that give information about the status of the mob

/mob/proc/can_hear()
. = 1
return TRUE

/mob/proc/has_vision(information_only = FALSE)
return 1
Expand Down

0 comments on commit cd16f0a

Please sign in to comment.