mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
Fixes harddels, reduces unneccessary update body calls (#88300)
Closes #88283 Closes https://github.com/tgstation/tgstation/issues/88320 Fixes a harddel caused by the limp status effect not being properly deleted Reduces update-body calls in: - Initialize from 4 to 1 - On z-level change from 2 to 1 - On move with bloody shoes from 1 to 0 Mostly by just passing along the proper argument and removing seemingly unnecessary update body calls
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// /datum/species signals
|
||||
///from datum/species/on_species_gain(): (datum/species/new_species, datum/species/old_species)
|
||||
///from datum/species/on_species_gain(): (datum/species/new_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
#define COMSIG_SPECIES_GAIN "species_gain"
|
||||
///from datum/species/on_species_loss(): (datum/species/lost_species)
|
||||
#define COMSIG_SPECIES_LOSS "species_loss"
|
||||
|
||||
@@ -211,7 +211,6 @@
|
||||
// Create new footprints
|
||||
if(theoretical_new_blood >= BLOOD_FOOTPRINTS_MIN)
|
||||
adjust_bloody_shoes(last_blood_state, blood_lost)
|
||||
update_icon()
|
||||
|
||||
var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom), footprint_sprite)
|
||||
if(!QDELETED(FP)) ///prints merged
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
eater_tongue.disliked_foodtypes &= ~GORE
|
||||
eater_tongue.liked_foodtypes |= GORE
|
||||
|
||||
/datum/component/heart_eater/proc/on_species_change(mob/living/carbon/human/eater, datum/species/new_species, datum/species/old_species)
|
||||
/datum/component/heart_eater/proc/on_species_change(mob/living/carbon/human/eater, datum/species/new_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
eater.dna?.species?.damage_modifier += remember_modifier
|
||||
|
||||
@@ -545,7 +545,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
|
||||
if (old_species.properly_gained)
|
||||
old_species.on_species_loss(src, new_race, pref_load)
|
||||
|
||||
dna.species.on_species_gain(src, old_species, pref_load)
|
||||
dna.species.on_species_gain(src, old_species, pref_load, regenerate_icons = icon_update)
|
||||
log_mob_tag("TAG: [tag] SPECIES: [key_name(src)] \[[mrace]\]")
|
||||
|
||||
/mob/living/carbon/human/set_species(datum/species/mrace, icon_update = TRUE, pref_load = FALSE)
|
||||
|
||||
@@ -25,5 +25,3 @@
|
||||
M.update_held_items()
|
||||
else
|
||||
M.update_clothing((target.slot_flags|update_flags))
|
||||
if(update_body)
|
||||
M.update_body()
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
human_holder.blood_volume = max(min_blood, human_holder.blood_volume - human_holder.dna.species.blood_deficiency_drain_rate * seconds_per_tick)
|
||||
|
||||
/datum/quirk/blooddeficiency/proc/update_mail(datum/source, datum/species/new_species, datum/species/old_species)
|
||||
/datum/quirk/blooddeficiency/proc/update_mail(datum/source, datum/species/new_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
mail_goodies.Cut()
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
status_type = STATUS_EFFECT_REPLACE
|
||||
tick_interval = STATUS_EFFECT_NO_TICK
|
||||
alert_type = /atom/movable/screen/alert/status_effect/limp
|
||||
on_remove_on_mob_delete = TRUE
|
||||
var/msg_stage = 0//so you dont get the most intense messages immediately
|
||||
/// The left leg of the limping person
|
||||
var/obj/item/bodypart/leg/left/left
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
*
|
||||
* (IE, no wacky hair styles / colors)
|
||||
*/
|
||||
/proc/randomize_human_normie(mob/living/carbon/human/human, randomize_mutations = FALSE)
|
||||
/proc/randomize_human_normie(mob/living/carbon/human/human, randomize_mutations = FALSE, update_body = TRUE)
|
||||
// Sorry enbys but statistically you are not average enough
|
||||
human.gender = human.dna.species.sexes ? pick(MALE, FEMALE) : PLURAL
|
||||
human.physique = human.gender
|
||||
@@ -59,4 +59,5 @@
|
||||
// Normal DNA init stuff, these can generally be wacky but we care less, they're aliens after all
|
||||
human.dna.initialize_dna(newblood_type = random_blood_type(), create_mutation_blocks = randomize_mutations, randomize_features = TRUE)
|
||||
human.updatehealth()
|
||||
human.updateappearance(mutcolor_update = TRUE)
|
||||
if(update_body)
|
||||
human.updateappearance(mutcolor_update = TRUE)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
BODY_ZONE_CHEST = /obj/item/bodypart/chest/shadow,
|
||||
)
|
||||
|
||||
/datum/species/shadow/nightmare/on_species_gain(mob/living/carbon/C, datum/species/old_species)
|
||||
/datum/species/shadow/nightmare/on_species_gain(mob/living/carbon/C, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
|
||||
C.fully_replace_character_name(null, pick(GLOB.nightmare_names))
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
siemens_coeff = 0
|
||||
|
||||
/datum/species/voidwalker/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load)
|
||||
/datum/species/voidwalker/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
|
||||
human_who_gained_species.AddComponent(/datum/component/glass_passer)
|
||||
|
||||
@@ -241,7 +241,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
* Arguments:
|
||||
* * old_species - The species that the carbon used to be before copying
|
||||
*/
|
||||
/datum/species/proc/copy_properties_from(datum/species/old_species)
|
||||
/datum/species/proc/copy_properties_from(datum/species/old_species, pref_load, regenerate_icons)
|
||||
return
|
||||
|
||||
/**
|
||||
@@ -364,8 +364,9 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
* * C - Carbon, this is whoever became the new species.
|
||||
* * old_species - The species that the carbon used to be before becoming this race, used for regenerating organs.
|
||||
* * pref_load - Preferences to be loaded from character setup, loads in preferred mutant things like bodyparts, digilegs, skin color, etc.
|
||||
* * regenerate_icons - Whether or not to update the bodies icons
|
||||
*/
|
||||
/datum/species/proc/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load)
|
||||
/datum/species/proc/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load, regenerate_icons = TRUE)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
|
||||
human_who_gained_species.living_flags |= STOP_OVERLAY_UPDATE_BODY_PARTS //Don't call update_body_parts() for every single bodypart overlay added.
|
||||
@@ -413,7 +414,8 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
human_who_gained_species.grant_language(language, SPOKEN_LANGUAGE, LANGUAGE_SPECIES)
|
||||
for(var/language in gaining_holder.blocked_languages)
|
||||
human_who_gained_species.add_blocked_language(language, LANGUAGE_SPECIES)
|
||||
human_who_gained_species.regenerate_icons()
|
||||
if(regenerate_icons)
|
||||
human_who_gained_species.regenerate_icons()
|
||||
|
||||
SEND_SIGNAL(human_who_gained_species, COMSIG_SPECIES_GAIN, src, old_species)
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
ADD_TRAIT(src, TRAIT_AGEUSIA, NO_TONGUE_TRAIT)
|
||||
|
||||
/mob/living/carbon/human/proc/setup_human_dna()
|
||||
randomize_human_normie(src, randomize_mutations = TRUE)
|
||||
randomize_human_normie(src, randomize_mutations = TRUE, update_body = FALSE)
|
||||
|
||||
/mob/living/carbon/human/Destroy()
|
||||
QDEL_NULL(physiology)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
return "Abductors do not need to breathe, eat, do not have blood, a heart, stomach, or lungs and cannot be infected by human viruses. \
|
||||
Their hardy physique prevents their skin from being wounded or dismembered, but their chunky tridactyl hands make it hard to operate human equipment."
|
||||
|
||||
/datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species)
|
||||
/datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
|
||||
abductor_hud.show_to(C)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/datum/species/dullahan/on_species_gain(mob/living/carbon/human/human, datum/species/old_species)
|
||||
/datum/species/dullahan/on_species_gain(mob/living/carbon/human/human, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
human.lose_hearing_sensitivity(TRAIT_GENERIC)
|
||||
RegisterSignal(human, COMSIG_CARBON_ATTACH_LIMB, PROC_REF(on_gained_part))
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
QDEL_NULL(ethereal_light)
|
||||
return ..()
|
||||
|
||||
/datum/species/ethereal/on_species_gain(mob/living/carbon/human/new_ethereal, datum/species/old_species, pref_load)
|
||||
/datum/species/ethereal/on_species_gain(mob/living/carbon/human/new_ethereal, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
if(!ishuman(new_ethereal))
|
||||
return
|
||||
@@ -272,7 +272,7 @@
|
||||
'sound/mobs/humanoids/ethereal/lustrous_scream_3.ogg',
|
||||
)
|
||||
|
||||
/datum/species/ethereal/lustrous/on_species_gain(mob/living/carbon/new_lustrous, datum/species/old_species, pref_load)
|
||||
/datum/species/ethereal/lustrous/on_species_gain(mob/living/carbon/new_lustrous, datum/species/old_species, pref_load, regenerate_icons)
|
||||
..()
|
||||
default_color = new_lustrous.dna.features["ethcolor"]
|
||||
new_lustrous.dna.features["ethcolor"] = GLOB.color_list_lustrous[pick(GLOB.color_list_lustrous)] //Picks one of 5 lustrous-specific colors.
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var/datum/reagent/toxin/carpotoxin/fish = chem
|
||||
fish.toxpwr = 0
|
||||
|
||||
/datum/species/human/felinid/on_species_gain(mob/living/carbon/carbon_being, datum/species/old_species, pref_load)
|
||||
/datum/species/human/felinid/on_species_gain(mob/living/carbon/carbon_being, datum/species/old_species, pref_load, regenerate_icons)
|
||||
if(ishuman(carbon_being))
|
||||
var/mob/living/carbon/human/target_human = carbon_being
|
||||
if(!pref_load) //Hah! They got forcefully purrbation'd. Force default felinid parts on them if they have no mutant parts in those areas!
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
BODY_ZONE_CHEST = /obj/item/bodypart/chest/fly,
|
||||
)
|
||||
|
||||
/datum/species/fly/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load)
|
||||
/datum/species/fly/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
RegisterSignal(human_who_gained_species, COMSIG_MOB_APPLY_DAMAGE_MODIFIERS, PROC_REF(damage_weakness))
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
)
|
||||
var/datum/action/innate/regenerate_limbs/regenerate_limbs
|
||||
|
||||
/datum/species/jelly/on_species_gain(mob/living/carbon/new_jellyperson, datum/species/old_species, pref_load)
|
||||
/datum/species/jelly/on_species_gain(mob/living/carbon/new_jellyperson, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
if(ishuman(new_jellyperson))
|
||||
regenerate_limbs = new
|
||||
@@ -209,7 +209,7 @@
|
||||
UnregisterSignal(C, COMSIG_LIVING_DEATH)
|
||||
..()
|
||||
|
||||
/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species)
|
||||
/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species, pref_load, regenerate_icons)
|
||||
..()
|
||||
if(ishuman(C))
|
||||
slime_split = new
|
||||
@@ -511,7 +511,7 @@
|
||||
QDEL_LIST(luminescent_actions)
|
||||
return ..()
|
||||
|
||||
/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/new_jellyperson, datum/species/old_species)
|
||||
/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/new_jellyperson, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
glow = new_jellyperson.mob_light(light_type = /obj/effect/dummy/lighting_obj/moblight/species)
|
||||
update_glow(new_jellyperson)
|
||||
@@ -677,7 +677,7 @@
|
||||
return "Stargazers can link others' minds with their own, creating a private communication channel. \
|
||||
Most things that are toxic heal them, but most things that prevent toxicity damage them!"
|
||||
|
||||
/datum/species/jelly/stargazer/on_species_gain(mob/living/carbon/grant_to, datum/species/old_species)
|
||||
/datum/species/jelly/stargazer/on_species_gain(mob/living/carbon/grant_to, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
project_action = new(src)
|
||||
project_action.Grant(grant_to)
|
||||
|
||||
@@ -218,7 +218,7 @@ Lizard subspecies: SILVER SCALED
|
||||
Mostly identical, they are holy, don't breathe, don't get viruses, their hide cannot be pierced, love the taste of wine, \
|
||||
and their tongue allows them to turn into a statue, for some reason."
|
||||
|
||||
/datum/species/lizard/silverscale/on_species_gain(mob/living/carbon/human/new_silverscale, datum/species/old_species, pref_load)
|
||||
/datum/species/lizard/silverscale/on_species_gain(mob/living/carbon/human/new_silverscale, datum/species/old_species, pref_load, regenerate_icons)
|
||||
old_mutcolor = new_silverscale.dna.features["mcolor"]
|
||||
new_silverscale.dna.features["mcolor"] = "#eeeeee"
|
||||
new_silverscale.add_eye_color("#0000a0", EYE_COLOR_SPECIES_PRIORITY)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
payday_modifier = 1.5
|
||||
ai_controlled_species = TRUE
|
||||
|
||||
/datum/species/monkey/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load)
|
||||
/datum/species/monkey/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
passtable_on(human_who_gained_species, SPECIES_TRAIT)
|
||||
human_who_gained_species.dna.add_mutation(/datum/mutation/human/race, MUT_NORMAL)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/moth,
|
||||
)
|
||||
|
||||
/datum/species/moth/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load)
|
||||
/datum/species/moth/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
RegisterSignal(human_who_gained_species, COMSIG_MOB_APPLY_DAMAGE_MODIFIERS, PROC_REF(damage_weakness))
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/datum/species/mush/check_roundstart_eligible()
|
||||
return FALSE //hard locked out of roundstart on the order of design lead kor, this can be removed in the future when planetstation is here OR SOMETHING but right now we have a problem with races.
|
||||
|
||||
/datum/species/mush/on_species_gain(mob/living/carbon/C, datum/species/old_species)
|
||||
/datum/species/mush/on_species_gain(mob/living/carbon/C, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
if(ishuman(C))
|
||||
mush = new()
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
affected.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM * seconds_per_tick)
|
||||
return COMSIG_MOB_STOP_REAGENT_CHECK
|
||||
|
||||
/datum/species/snail/on_species_gain(mob/living/carbon/new_snailperson, datum/species/old_species, pref_load)
|
||||
/datum/species/snail/on_species_gain(mob/living/carbon/new_snailperson, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
var/obj/item/storage/backpack/bag = new_snailperson.get_item_by_slot(ITEM_SLOT_BACK)
|
||||
if(!istype(bag, /obj/item/storage/backpack/snail))
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/datum/species/human/vampire/on_species_gain(mob/living/carbon/human/new_vampire, datum/species/old_species)
|
||||
/datum/species/human/vampire/on_species_gain(mob/living/carbon/human/new_vampire, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
to_chat(new_vampire, "[info_text]")
|
||||
new_vampire.skin_tone = "albino"
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/zombie/infectious,
|
||||
)
|
||||
|
||||
/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/human/new_zombie, datum/species/old_species)
|
||||
/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/human/new_zombie, datum/species/old_species, pref_load, regenerate_icons)
|
||||
. = ..()
|
||||
new_zombie.set_combat_mode(TRUE)
|
||||
|
||||
|
||||
@@ -525,7 +525,7 @@
|
||||
unset_wearer()
|
||||
old_wearer.temporarilyRemoveItemFromInventory(src)
|
||||
|
||||
/obj/item/mod/control/proc/on_species_gain(datum/source, datum/species/new_species, datum/species/old_species)
|
||||
/obj/item/mod/control/proc/on_species_gain(datum/source, datum/species/new_species, datum/species/old_species, pref_load, regenerate_icons)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
for(var/obj/item/part in get_parts(all = TRUE))
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
. = ..()
|
||||
receiver.cure_blind(NO_EYES)
|
||||
apply_damaged_eye_effects()
|
||||
refresh(receiver, call_update = TRUE)
|
||||
refresh(receiver, call_update = !special)
|
||||
RegisterSignal(receiver, COMSIG_ATOM_BULLET_ACT, PROC_REF(on_bullet_act))
|
||||
if (scarring)
|
||||
apply_scarring_effects()
|
||||
|
||||
Reference in New Issue
Block a user