Fix carbons deathgasping twice (#84347)

## 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

🆑 Melbert
fix: Lizards and Moths don't deathgasp twice when they die
/🆑
This commit is contained in:
MrMelbert
2024-06-26 23:55:50 -04:00
committed by GitHub
parent 8962d9df6a
commit 8a16be72ee
5 changed files with 9 additions and 6 deletions
+3
View File
@@ -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)
@@ -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.
@@ -122,4 +123,3 @@
var/bodyshape = BODYSHAPE_HUMANOID
COOLDOWN_DECLARE(bleeding_message_cd)
-1
View File
@@ -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)
+4 -3
View File
@@ -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 <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)
+1 -1
View File
@@ -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