From 5d19101b3fcc84422cdba1cdd9555aacb8bdfb58 Mon Sep 17 00:00:00 2001 From: Lucy Date: Wed, 13 Nov 2024 13:22:06 -0500 Subject: [PATCH] =?UTF-8?q?hrrrrnnggh=20colonel,=20I=E2=80=99m=20trying=20?= =?UTF-8?q?to=20fix=20runtimes=20but=20I'm=20*dummy=20thicc*=20and=20the?= =?UTF-8?q?=20clap=20from=20my=20asscheeks=20keeps=20alerting=20runtime.lo?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/_onclick/hud/new_player.dm | 9 +++++---- code/controllers/subsystem/persistence/scars.dm | 2 +- code/controllers/subsystem/ticker.dm | 5 ++--- code/datums/cinematics/_cinematic.dm | 2 +- code/game/objects/items/food/egg.dm | 2 +- code/modules/bitrunning/event.dm | 9 +++------ .../modules/client/preferences/middleware/antags.dm | 6 +++--- code/modules/mob/login.dm | 4 ++-- code/modules/mob/mob.dm | 5 ++--- .../vatgrowing/samples/_micro_organism.dm | 2 +- monkestation/code/modules/liquids/liquid_groups.dm | 3 ++- .../modules/store/pre_round/_pre_round_store.dm | 13 ++++--------- 12 files changed, 27 insertions(+), 35 deletions(-) diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index a6e139dad084..902d1fa07154 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -153,10 +153,11 @@ if(ready) new_player.ready = PLAYER_READY_TO_PLAY base_icon_state = "ready" - if(!new_player.client.readied_store) - new_player.client.readied_store = new(new_player) - else - new_player.client.readied_store.ui_interact(new_player) + var/client/new_client = new_player.client + if(new_client) + if(!new_client.readied_store) + new_client.readied_store = new(new_player) + new_client.readied_store.ui_interact(new_player) else new_player.ready = PLAYER_NOT_READY base_icon_state = "not_ready" diff --git a/code/controllers/subsystem/persistence/scars.dm b/code/controllers/subsystem/persistence/scars.dm index fa378f24dd43..5c6a76f4e134 100644 --- a/code/controllers/subsystem/persistence/scars.dm +++ b/code/controllers/subsystem/persistence/scars.dm @@ -5,7 +5,7 @@ if(!istype(ending_human) || !ending_human.mind?.original_character_slot_index || !ending_human.client?.prefs.read_preference(/datum/preference/toggle/persistent_scars)) continue - var/mob/living/carbon/human/original_human = ending_human.mind.original_character.resolve() + var/mob/living/carbon/human/original_human = ending_human.mind.original_character?.resolve() if(!original_human) continue diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 7b8afe4ac44d..2bb519f79477 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -473,9 +473,8 @@ SUBSYSTEM_DEF(ticker) continue item.post_equip_item(new_player_mob.client?.prefs, new_player_living) - if(new_player_mob.client.readied_store) - if(new_player_mob.client.readied_store.bought_item) - new_player_mob.client.readied_store.finalize_purchase_spawn(new_player_mob, new_player_living) + if(new_player_mob.client?.readied_store?.bought_item) + new_player_mob.client.readied_store.finalize_purchase_spawn(new_player_mob, new_player_living) CHECK_TICK diff --git a/code/datums/cinematics/_cinematic.dm b/code/datums/cinematics/_cinematic.dm index 628e7b60e353..1ea32a362d73 100644 --- a/code/datums/cinematics/_cinematic.dm +++ b/code/datums/cinematics/_cinematic.dm @@ -155,7 +155,7 @@ /// Unlocks a previously locked weakref /datum/cinematic/proc/unlock_mob(datum/weakref/mob_ref) - var/mob/locked_mob = mob_ref.resolve() + var/mob/locked_mob = mob_ref?.resolve() if(isnull(locked_mob)) return REMOVE_TRAIT(locked_mob, TRAIT_NO_TRANSFORM, CINEMATIC_SOURCE) diff --git a/code/game/objects/items/food/egg.dm b/code/game/objects/items/food/egg.dm index dee71be9accb..b5921949760e 100644 --- a/code/game/objects/items/food/egg.dm +++ b/code/game/objects/items/food/egg.dm @@ -77,7 +77,7 @@ GLOBAL_VAR_INIT(chicks_from_eggs, 0) pre_hatch() GLOB.chicks_from_eggs++ - reagents.expose(hit_atom, TOUCH) + reagents?.expose(hit_atom, TOUCH) /obj/item/food/egg/attackby(obj/item/item, mob/user, params) if(istype(item, /obj/item/toy/crayon)) diff --git a/code/modules/bitrunning/event.dm b/code/modules/bitrunning/event.dm index 8a199952aefd..0018117255f2 100644 --- a/code/modules/bitrunning/event.dm +++ b/code/modules/bitrunning/event.dm @@ -21,14 +21,11 @@ /datum/round_event_control/bitrunning_glitch/can_spawn_event(players_amt, allow_magic = FALSE, fake_check = FALSE) . = ..() if(!.) - return . - + return active_servers.Cut() - get_active_servers() - - if(length(active_servers)) - return TRUE + if(!length(active_servers)) + return FALSE /// All servers currently running, has players in it, and map has valid mobs /datum/round_event_control/bitrunning_glitch/proc/get_active_servers() diff --git a/code/modules/client/preferences/middleware/antags.dm b/code/modules/client/preferences/middleware/antags.dm index 5239fa9a9953..bb3e1a607bf9 100644 --- a/code/modules/client/preferences/middleware/antags.dm +++ b/code/modules/client/preferences/middleware/antags.dm @@ -17,11 +17,11 @@ data["selected_antags"] = selected_antags var/list/antag_bans = get_antag_bans() - if (antag_bans.len) + if (length(antag_bans)) data["antag_bans"] = antag_bans var/list/antag_days_left = get_antag_days_left() - if (antag_days_left?.len) + if (length(antag_days_left)) data["antag_days_left"] = antag_days_left return data @@ -66,7 +66,7 @@ if (isnull(antag_flag)) continue - if (is_banned_from(preferences.parent.ckey, list(antag_flag_override || antag_flag, ROLE_SYNDICATE))) + if (is_banned_from(preferences.parent?.ckey, list(antag_flag_override || antag_flag, ROLE_SYNDICATE))) antag_bans += serialize_antag_name(antag_flag) return antag_bans diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 67539f876b98..48de22c8a762 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -46,9 +46,9 @@ if(hud_used) if (forced_interaction_mode) - client.imode.replace(forced_interaction_mode) + client.imode?.replace(forced_interaction_mode) else - client.imode.reload_hud(src) + client.imode?.reload_hud(src) hud_used.show_hud(hud_used.hud_version) // see above, this can process a disconnect if(!client) return FALSE diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ea0fee8f9dfb..d01c158dcd9c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1488,9 +1488,8 @@ if(!canon_client) return - for(var/foo in canon_client.player_details.post_logout_callbacks) - var/datum/callback/CB = foo - CB.Invoke() + for(var/datum/callback/callback as anything in canon_client.player_details?.post_logout_callbacks) + callback.Invoke() if(canon_client?.movingmob) LAZYREMOVE(canon_client.movingmob.client_mobs_in_contents, src) diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm index 140983d7b7de..05c03fdee634 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm @@ -73,7 +73,7 @@ /datum/micro_organism/cell_line/proc/finish_growing(obj/machinery/plumbing/growing_vat/vat) var/risk = 0 //Penalty for failure, goes up based on how much growth the other cell_lines have - for(var/datum/micro_organism/cell_line/cell_line in vat.biological_sample.micro_organisms) + for(var/datum/micro_organism/cell_line/cell_line in vat.biological_sample?.micro_organisms) if(cell_line == src) //well duh continue if(cell_line.growth >= VATGROWING_DANGER_MINIMUM) diff --git a/monkestation/code/modules/liquids/liquid_groups.dm b/monkestation/code/modules/liquids/liquid_groups.dm index d29777796b31..ce701c3f4690 100644 --- a/monkestation/code/modules/liquids/liquid_groups.dm +++ b/monkestation/code/modules/liquids/liquid_groups.dm @@ -205,9 +205,10 @@ GLOBAL_VAR_INIT(liquid_debug_colors, FALSE) ///PROCESSING /datum/liquid_group/proc/process_group(from_SS = FALSE) + list_clear_nulls(members) if(merging) return - if(!members || !length(members)) // this ideally shouldn't exist, ideally groups would die before they got to this point but alas here we are + if(!length(members)) // this ideally shouldn't exist, ideally groups would die before they got to this point but alas here we are check_dead() return diff --git a/monkestation/code/modules/store/pre_round/_pre_round_store.dm b/monkestation/code/modules/store/pre_round/_pre_round_store.dm index 30b5b849104c..697c5a4bc0f5 100644 --- a/monkestation/code/modules/store/pre_round/_pre_round_store.dm +++ b/monkestation/code/modules/store/pre_round/_pre_round_store.dm @@ -6,13 +6,10 @@ GLOBAL_LIST_EMPTY(cached_preround_items) /datum/pre_round_store var/datum/store_item/bought_item -/datum/pre_round_store/New(mob/user) - . = ..() - ui_interact(user) - /datum/pre_round_store/Destroy(force) - . = ..() + SStgui.close_uis(src) bought_item = null + return ..() /datum/pre_round_store/ui_interact(mob/user, datum/tgui/ui) . = ..() @@ -95,8 +92,7 @@ GLOBAL_LIST_EMPTY(cached_preround_items) if(!granting_time.grant_effect(new_player_mob_living)) return else - ui_close() - qdel(new_player_mob.client.readied_store) + QDEL_NULL(new_player_mob.client.readied_store) return else if(!new_player_mob.put_in_hands(created_item, FALSE)) var/obj/item/storage/backpack/backpack = new_player_mob_living.get_item_by_slot(ITEM_SLOT_BACK) @@ -107,5 +103,4 @@ GLOBAL_LIST_EMPTY(cached_preround_items) owners_prefs.adjust_metacoins(new_player_mob.client.ckey, (-initial(bought_item.item_cost)), donator_multipler = FALSE) logger.Log(LOG_CATEGORY_META, "[new_player_mob.client] bought a [created_item] for [initial(bought_item.item_cost)] (Pre-round Store)", list("currency_left" = new_player_mob.client.prefs.metacoins)) - ui_close() - qdel(new_player_mob.client.readied_store) + QDEL_NULL(new_player_mob.client.readied_store)