From 5470fdd25c1ceab0f5652a350815e0bac29491ee Mon Sep 17 00:00:00 2001 From: Dip Date: Fri, 23 Oct 2020 21:15:06 -0300 Subject: [PATCH 1/2] squashing some runtimes --- code/game/objects/effects/effect_system/effect_system.dm | 6 +++++- code/modules/jobs/job_types/job.dm | 2 +- .../mob/living/carbon/human/species_types/android.dm | 4 +++- code/modules/surgery/bodyparts/bodyparts.dm | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/game/objects/effects/effect_system/effect_system.dm b/code/game/objects/effects/effect_system/effect_system.dm index ddc805f3..2fe28e8b 100644 --- a/code/game/objects/effects/effect_system/effect_system.dm +++ b/code/game/objects/effects/effect_system/effect_system.dm @@ -48,6 +48,8 @@ would spawn and follow the beaker, even if it is carried or thrown. holder = atom /datum/effect_system/proc/start() + if(QDELETED(src)) + return for(var/i in 1 to number) if(total_effects > 20) return @@ -56,7 +58,7 @@ would spawn and follow the beaker, even if it is carried or thrown. /datum/effect_system/proc/generate_effect() if(holder) location = get_turf(holder) - if(location.contents.len > 200) //Bandaid to prevent server crash exploit + if(location?.contents.len > 200) //Bandaid to prevent server crash exploit return var/obj/effect/E = new effect_type(location) total_effects++ @@ -70,6 +72,8 @@ would spawn and follow the beaker, even if it is carried or thrown. sleep(5) step(E,direction) addtimer(CALLBACK(src, .proc/decrement_total_effect), 20) + if(!QDELETED(src)) + addtimer(CALLBACK(src, .proc/decrement_total_effect), 20) /datum/effect_system/proc/decrement_total_effect() total_effects-- diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 50989934..ea3b1fcf 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -122,7 +122,7 @@ /datum/job/proc/announce_head(var/mob/living/carbon/human/H, var/channels) //tells the given channel that the given mob is the new department head. See communications.dm for valid channels. if(H && GLOB.announcement_systems.len) //timer because these should come after the captain announcement - SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/addtimer, CALLBACK(pick(GLOB.announcement_systems), /obj/machinery/announcement_system/proc/announce, "NEWHEAD", H.real_name, H.job, H.client.prefs.alt_titles_preferences[H.job], channels), 1)) + SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/addtimer, CALLBACK(pick(GLOB.announcement_systems), /obj/machinery/announcement_system/proc/announce, "NEWHEAD", H.real_name, H.job, H.client?.prefs.alt_titles_preferences[H.job], channels), 1)) //If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1 /datum/job/proc/player_old_enough(client/C) diff --git a/code/modules/mob/living/carbon/human/species_types/android.dm b/code/modules/mob/living/carbon/human/species_types/android.dm index ad9ba837..0f522b55 100644 --- a/code/modules/mob/living/carbon/human/species_types/android.dm +++ b/code/modules/mob/living/carbon/human/species_types/android.dm @@ -11,14 +11,16 @@ mutanttongue = /obj/item/organ/tongue/robot limbs_id = "synth" -/datum/species/android/on_species_gain(mob/living/carbon/C) +/datum/species/android/on_species_gain(mob/living/carbon/human/C) . = ..() for(var/X in C.bodyparts) var/obj/item/bodypart/O = X O.change_bodypart_status(BODYPART_ROBOTIC, FALSE, TRUE) + C.grant_language(/datum/language/machine) /datum/species/android/on_species_loss(mob/living/carbon/C) . = ..() for(var/X in C.bodyparts) var/obj/item/bodypart/O = X O.change_bodypart_status(BODYPART_ORGANIC,FALSE, TRUE) + C.remove_language(/datum/language/machine) diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 408133d2..496cb708 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -287,7 +287,7 @@ if(status == BODYPART_ORGANIC) icon = base_bp_icon || DEFAULT_BODYPART_ICON_ORGANIC else if(status == BODYPART_ROBOTIC) - icon = base_bp_icon || DEFAULT_BODYPART_ICON_ROBOTIC + icon = DEFAULT_BODYPART_ICON_ROBOTIC if(owner) owner.updatehealth() From e162b8c36f382b343891e8ab3778b26d62bf5759 Mon Sep 17 00:00:00 2001 From: Dip Date: Sat, 24 Oct 2020 00:02:45 -0300 Subject: [PATCH 2/2] fixes invisible skellingtons --- code/modules/mob/living/carbon/human/species_types/skeletons.dm | 1 + code/modules/mob/living/carbon/human/species_types/zombies.dm | 1 + 2 files changed, 2 insertions(+) diff --git a/code/modules/mob/living/carbon/human/species_types/skeletons.dm b/code/modules/mob/living/carbon/human/species_types/skeletons.dm index 6c9d95e8..7d739990 100644 --- a/code/modules/mob/living/carbon/human/species_types/skeletons.dm +++ b/code/modules/mob/living/carbon/human/species_types/skeletons.dm @@ -22,6 +22,7 @@ /datum/species/skeleton/space name = "Spooky Spacey Skeleton" id = "spaceskeleton" + limbs_id = "skeleton" blacklisted = 1 inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_FAKEDEATH, TRAIT_CALCIUM_HEALER) diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index 9263aea9..3f417da1 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -18,6 +18,7 @@ /datum/species/zombie/notspaceproof id = "notspaceproofzombie" + limbs_id = "zombie" blacklisted = 0 inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NOBREATH,TRAIT_NODEATH,TRAIT_FAKEDEATH)