From 58850b75af50a2958fbe9edb4d6e7006eb3a2eb9 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:14:05 +0200 Subject: [PATCH] [MIRROR] Fix carbons deathgasping twice (#28409) * Fix carbons deathgasping twice * Update carbon_defines.dm * Update carbon_defines.dm --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com> --- code/__DEFINES/living.dm | 3 +++ code/modules/mob/living/carbon/carbon_defines.dm | 1 + code/modules/mob/living/carbon/death.dm | 1 - code/modules/mob/living/death.dm | 7 ++++--- code/modules/wiremod/shell/drone.dm | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/living.dm b/code/__DEFINES/living.dm index 1f2316e8e12..63993f4bc62 100644 --- a/code/__DEFINES/living.dm +++ b/code/__DEFINES/living.dm @@ -1,3 +1,6 @@ // living_flags /// Simple mob trait, indicating it may follow continuous move actions controlled by code instead of by user input. #define MOVES_ON_ITS_OWN (1<<0) +/// Always does *deathgasp when they die +/// If unset mobs will only deathgasp if supplied a death sound or custom death message +#define ALWAYS_DEATHGASP (1<<1) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 7499b2055d3..240f45521a7 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -11,6 +11,7 @@ usable_hands = 0 //Populated on init through list/bodyparts mobility_flags = MOBILITY_FLAGS_CARBON_DEFAULT blocks_emissive = EMISSIVE_BLOCK_NONE + living_flags = ALWAYS_DEATHGASP ///List of [/obj/item/organ]s in the mob. They don't go in the contents for some reason I don't want to know. var/list/obj/item/organ/organs = list() ///Same as [above][/mob/living/carbon/var/organs], but stores "slot ID" - "organ" pairs for easy access. diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 41a958518c5..5fdd3498f15 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -5,7 +5,6 @@ losebreath = 0 if(!gibbed) - INVOKE_ASYNC(src, PROC_REF(emote), "deathgasp") add_memory_in_range(src, 7, /datum/memory/witnessed_death, protagonist = src) reagents.end_metabolization(src) diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 51fb86d73ad..1f94edf44cd 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -104,7 +104,7 @@ if(stat == DEAD) return FALSE - if(!gibbed && (death_sound || death_message)) + if(!gibbed && (death_sound || death_message || (living_flags & ALWAYS_DEATHGASP))) INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, emote), "deathgasp") set_stat(DEAD) @@ -116,8 +116,9 @@ var/player_mob_check = mind && mind.name && mind.active // and, display a death message if the area allows it (or if they're in nullspace) var/valid_area_check = !death_area || !(death_area.area_flags & NO_DEATH_MESSAGE) - if(player_mob_check && valid_area_check) - deadchat_broadcast(" has died at [get_area_name(death_turf)].", "[mind.name]", follow_target = src, turf_target = death_turf, message_type=DEADCHAT_DEATHRATTLE) + if(player_mob_check) + if(valid_area_check) + deadchat_broadcast(" has died at [get_area_name(death_turf)].", "[mind.name]", follow_target = src, turf_target = death_turf, message_type=DEADCHAT_DEATHRATTLE) if(SSlag_switch.measures[DISABLE_DEAD_KEYLOOP] && !client?.holder) to_chat(src, span_deadsay(span_big("Observer freelook is disabled.\nPlease use Orbit, Teleport, and Jump to look around."))) ghostize(TRUE) diff --git a/code/modules/wiremod/shell/drone.dm b/code/modules/wiremod/shell/drone.dm index 4627a3cf326..d2922274b7d 100644 --- a/code/modules/wiremod/shell/drone.dm +++ b/code/modules/wiremod/shell/drone.dm @@ -9,7 +9,7 @@ icon_state = "setup_medium_med" maxHealth = 300 health = 300 - living_flags = 0 + living_flags = NONE light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE