From 61e0cff36f336c4d986b055ba1e155b6588dd0d7 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Wed, 25 Jan 2023 10:44:06 -0500 Subject: [PATCH 1/3] pets runtime --- code/__HELPERS/unsorted.dm | 2 +- code/controllers/configuration/configuration.dm | 2 ++ code/datums/components/religious_tool.dm | 3 +++ code/modules/mob/living/carbon/human/species.dm | 2 +- .../file_system/programs/medical/chem_scan.dm | 1 + code/modules/research/nanites/nanite_programs/healing.dm | 4 ++-- yogstation/code/modules/admin/verbs/adminhelp.dm | 2 ++ 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index fb2621081abf..36d1482a0602 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -197,7 +197,7 @@ Turf and target are separate in case you want to teleport some distance from a t var/banned = C ? is_banned_from(C.ckey, "Appearance") : null while(loop && safety < 5) - if(C && C.prefs.custom_names[role] && !safety && !banned) + if(C && C.prefs?.custom_names[role] && !safety && !banned) newname = C.prefs.custom_names[role] else switch(role) diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index ff1cd67bed88..c85a03c950e2 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -196,6 +196,8 @@ var/entry_is_abstract = initial(E.abstract_type) == entry_type if(entry_is_abstract) CRASH("Tried to retrieve an abstract config_entry: [entry_type]") + if(!islist(entries_by_type)) + CRASH("entries_by_type is not a list when trying to get: [entry_type]") E = entries_by_type[entry_type] if(!E) CRASH("Missing config entry for [entry_type]!") diff --git a/code/datums/components/religious_tool.dm b/code/datums/components/religious_tool.dm index 416129c12e39..cc29c1a8d1ad 100644 --- a/code/datums/components/religious_tool.dm +++ b/code/datums/components/religious_tool.dm @@ -96,6 +96,9 @@ return var/selection2type = easy_access_sect.rites_list[rite_select] performing_rite = new selection2type(parent) + if(!performing_rite) + to_chat(user, span_warning("Type [rite_select] is not a valid rite! Please make a bug report!")) + return if(!performing_rite.perform_rite(user, parent)) QDEL_NULL(performing_rite) else diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 02825d43a730..53d5da492356 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -2121,7 +2121,7 @@ GLOBAL_LIST_EMPTY(mentor_races) if(H.IsParalyzed() || H.IsStun()) return FALSE var/obj/item/organ/tail = H.getorganslot(ORGAN_SLOT_TAIL) - return tail.get_availability(H.dna.species) + return tail?.get_availability(H.dna.species) /datum/species/proc/is_wagging_tail(mob/living/carbon/human/H) return ("waggingtail_human" in mutant_bodyparts) || ("waggingtail_lizard" in mutant_bodyparts) diff --git a/code/modules/modular_computers/file_system/programs/medical/chem_scan.dm b/code/modules/modular_computers/file_system/programs/medical/chem_scan.dm index d3639e991bc6..9230f629f095 100644 --- a/code/modules/modular_computers/file_system/programs/medical/chem_scan.dm +++ b/code/modules/modular_computers/file_system/programs/medical/chem_scan.dm @@ -46,6 +46,7 @@ if(lastscan.len) data["chems"] = lastscan["reagents"]["reagentlist"] else + lastscan["reagents"] = list() data["chems"] = lastscan["reagents"]["reagentlist"] = list() return data diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 837d999a22cd..df87a61987f5 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -149,7 +149,7 @@ /datum/nanite_program/purging_advanced/check_conditions() var/foreign_reagent = FALSE - for(var/datum/reagent/toxin/R in host_mob.reagents.reagent_list) + for(var/datum/reagent/toxin/R in host_mob.reagents?.reagent_list) foreign_reagent = TRUE break if(!host_mob.getToxLoss() && !foreign_reagent) @@ -158,7 +158,7 @@ /datum/nanite_program/purging_advanced/active_effect() host_mob.adjustToxLoss(-1) - for(var/datum/reagent/toxin/R in host_mob.reagents.reagent_list) + for(var/datum/reagent/toxin/R in host_mob.reagents?.reagent_list) host_mob.reagents.remove_reagent(R.type,1) /datum/nanite_program/regenerative_advanced diff --git a/yogstation/code/modules/admin/verbs/adminhelp.dm b/yogstation/code/modules/admin/verbs/adminhelp.dm index 15367cf94caa..255c4f86782a 100644 --- a/yogstation/code/modules/admin/verbs/adminhelp.dm +++ b/yogstation/code/modules/admin/verbs/adminhelp.dm @@ -934,6 +934,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) /proc/get_admin_counts(requiredflags = R_BAN) . = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list()) + if(!GLOB.permissions) + CRASH("Tried to fetch admin counts when permissions were not initialized") for(var/client/X in GLOB.permissions.admins) .["total"] += X if(requiredflags != 0 && !check_rights_for(X, requiredflags)) From 2ea2bf898bb751008cc8d0c77a49f36ac4740e4c Mon Sep 17 00:00:00 2001 From: ynot01 Date: Thu, 26 Jan 2023 10:34:07 -0500 Subject: [PATCH 2/3] Update unsorted.dm --- code/__HELPERS/unsorted.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 36d1482a0602..7c54ca521412 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -197,7 +197,9 @@ Turf and target are separate in case you want to teleport some distance from a t var/banned = C ? is_banned_from(C.ckey, "Appearance") : null while(loop && safety < 5) - if(C && C.prefs?.custom_names[role] && !safety && !banned) + if(C && C.prefs.custom_names[role] && !safety && !banned) + if(!C.prefs) + CRASH("[C] prefs don't exist! Yell at ling") newname = C.prefs.custom_names[role] else switch(role) From 09b8c91829272b2a02da9e39844faca38e6d2340 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Fri, 27 Jan 2023 16:56:21 -0500 Subject: [PATCH 3/3] Update unsorted.dm --- code/__HELPERS/unsorted.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 7c54ca521412..fb2621081abf 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -198,8 +198,6 @@ Turf and target are separate in case you want to teleport some distance from a t while(loop && safety < 5) if(C && C.prefs.custom_names[role] && !safety && !banned) - if(!C.prefs) - CRASH("[C] prefs don't exist! Yell at ling") newname = C.prefs.custom_names[role] else switch(role)