Skip to content

Commit

Permalink
Fix carbons deathgasping twice (tgstation#84347)
Browse files Browse the repository at this point in the history
## About The Pull Request

They deathgasped once on the carbon level and once on the living level

I also realized this check I added a while back breaks lag check
mechanism so let's just change that around

## Changelog

:cl: Melbert
fix: Lizards and Moths don't deathgasp twice when they die
/:cl:
  • Loading branch information
MrMelbert authored Jun 27, 2024
1 parent 8962d9d commit 8a16be7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -122,4 +123,3 @@
var/bodyshape = BODYSHAPE_HUMANOID

COOLDOWN_DECLARE(bleeding_message_cd)

1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 4 additions & 3 deletions code/modules/mob/living/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 <b>[get_area_name(death_turf)]</b>.", "<b>[mind.name]</b>", follow_target = src, turf_target = death_turf, message_type=DEADCHAT_DEATHRATTLE)
if(player_mob_check)
if(valid_area_check)
deadchat_broadcast(" has died at <b>[get_area_name(death_turf)]</b>.", "<b>[mind.name]</b>", 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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/wiremod/shell/drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8a16be7

Please sign in to comment.