From b672ca8693e9ff81a73cf80c4824858e0d34654f Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 20 Apr 2025 20:58:25 -0700 Subject: [PATCH] [MIRROR] fix a bunch of runtimes (#10683) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/game/machinery/computer/camera.dm | 1 + code/game/objects/mail.dm | 2 +- code/modules/admin/verbs/buildmode.dm | 9 ++++++++- code/modules/mob/new_player/new_player.dm | 2 +- .../reagent_containers/_reagent_containers.dm | 2 ++ code/modules/tgui/modules/camera.dm | 15 ++++++++++----- code/modules/vore/persist/persist_vr.dm | 5 ++++- 7 files changed, 27 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 516d95faec..1638d13938 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -119,6 +119,7 @@ GLOBAL_LIST_EMPTY(bodycamera_screens) // CHOMPEdit power_change() /obj/machinery/computer/security/telescreen/entertainment/Destroy() + GLOB.entertainment_screens -= src if(showing) stop_showing() vis_contents.Cut() diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm index 4bee1f674d..e368a966f4 100644 --- a/code/game/objects/mail.dm +++ b/code/game/objects/mail.dm @@ -195,7 +195,7 @@ /obj/item/mail/proc/unwrap(mob/user) if(recipient_ref) var/datum/mind/recipient = recipient_ref.resolve() - if(recipient && recipient.current.dna.unique_enzymes != user.dna.unique_enzymes) + if(recipient && recipient.current?.dna.unique_enzymes != user.dna.unique_enzymes) to_chat(user, span_danger("You can't open somebody's mail! That's illegal")) return FALSE diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index ce43f49414..298b3b5d71 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -11,6 +11,8 @@ #define LAST_BUILDMODE 10 +GLOBAL_LIST_EMPTY(active_buildmode_holders) + /proc/togglebuildmode(mob/M as mob in player_list) set name = "Toggle Build Mode" set category = "Special Verbs" @@ -20,7 +22,7 @@ M.client.buildmode = 0 M.client.show_popup_menus = 1 M.plane_holder.set_vis(VIS_BUILDMODE, FALSE) - for(var/obj/effect/bmode/buildholder/H) + for(var/obj/effect/bmode/buildholder/H in GLOB.active_buildmode_holders) if(H.cl == M.client) qdel(H) else @@ -205,7 +207,12 @@ var/copied_faction = null var/warned = 0 +/obj/effect/bmode/buildholder/Initialize(mapload) + . = ..() + GLOB.active_buildmode_holders += src + /obj/effect/bmode/buildholder/Destroy() + GLOB.active_buildmode_holders -= src qdel(builddir) builddir = null qdel(buildhelp) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index d799247c13..c3663a1c3c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -117,7 +117,7 @@ output += "" - if (client.prefs.lastlorenews == GLOB.news_data.newsindex) + if (client.prefs?.lastlorenews == GLOB.news_data.newsindex) client.seen_news = 1 if(GLOB.news_data.station_newspaper && !client.seen_news && client.prefs?.read_preference(/datum/preference/toggle/show_lore_news)) diff --git a/code/modules/reagents/reagent_containers/_reagent_containers.dm b/code/modules/reagents/reagent_containers/_reagent_containers.dm index 1742d91f5c..31988ae27d 100644 --- a/code/modules/reagents/reagent_containers/_reagent_containers.dm +++ b/code/modules/reagents/reagent_containers/_reagent_containers.dm @@ -167,6 +167,8 @@ return 1 /obj/item/reagent_containers/proc/liquid_belly_check() + if(!reagents) + return FALSE for(var/datum/reagent/R in reagents.reagent_list) if(R.from_belly) return TRUE diff --git a/code/modules/tgui/modules/camera.dm b/code/modules/tgui/modules/camera.dm index 793029a601..36dcb4c318 100644 --- a/code/modules/tgui/modules/camera.dm +++ b/code/modules/tgui/modules/camera.dm @@ -83,7 +83,7 @@ var/turf/newturf = get_turf(active_camera) var/area/B = newturf?.loc // No cam tracking in dorms! // Show static if can't use the camera - if(!active_camera?.can_use() || B.flag_check(AREA_BLOCK_TRACKING)) + if(!active_camera?.can_use() || B?.flag_check(AREA_BLOCK_TRACKING)) show_camera_static() if(!ui) var/user_ref = REF(user) @@ -143,9 +143,10 @@ var/obj/machinery/camera/C = cameras["[ckey(c_tag)]"] if(active_camera) UnregisterSignal(active_camera, COMSIG_OBSERVER_MOVED) - active_camera = C - active_camera.AddComponent(/datum/component/recursive_move) - RegisterSignal(active_camera, COMSIG_OBSERVER_MOVED, PROC_REF(update_active_camera_screen)) + if(C) + active_camera = C + active_camera.AddComponent(/datum/component/recursive_move) + RegisterSignal(active_camera, COMSIG_OBSERVER_MOVED, PROC_REF(update_active_camera_screen)) playsound(tgui_host(), get_sfx("terminal_type"), 25, FALSE) update_active_camera_screen() return TRUE @@ -179,10 +180,14 @@ . = TRUE /datum/tgui_module/camera/proc/update_active_camera_screen() + if(!active_camera) + show_camera_static() + return TRUE + var/turf/newturf = get_turf(active_camera) var/area/B = newturf?.loc // No cam tracking in dorms! // Show static if can't use the camera - if(!active_camera?.can_use() || B.flag_check(AREA_BLOCK_TRACKING)) + if(!active_camera.can_use() || B?.flag_check(AREA_BLOCK_TRACKING)) show_camera_static() return TRUE diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index ae68baab39..eb4b29f882 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -15,7 +15,7 @@ // Handle people leaving due to round ending. /hook/roundend/proc/persist_locations() - for(var/mob/Player in human_mob_list) + for(var/mob/living/carbon/human/Player in human_mob_list) if(!Player.mind || isnewplayer(Player)) continue // No mind we can do nothing, new players we care not for else if(Player.stat == DEAD) @@ -27,6 +27,9 @@ persist_interround_data(Player, using_map.spawnpoint_died) else var/turf/playerTurf = get_turf(Player) + if(!playerTurf) + log_debug("Player [Player.name] ([Player.ckey]) playing as [Player.species] was in nullspace at round end.") + continue if(isAdminLevel(playerTurf.z)) // Evac'd - Next round they arrive on the shuttle. persist_interround_data(Player, using_map.spawnpoint_left)