From 4007cf7a655dca5878bd78ecdf79ccb13aaa327e Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Thu, 4 Jan 2024 19:53:37 -0500 Subject: [PATCH] Fixes some image hard dels, and adds context to qdeleting images. (#80736) ## About The Pull Request (see https://github.com/NovaSector/NovaSector/pull/250 , credit to capsaicinz for tracking these!). Upstreaming the fixes for some bot hard dels likely brought up by a recent PR. There are a lot of them because it is qdeleting a whole list of them at a time. Example log: ![image](https://github.com/tgstation/tgstation/assets/13398309/defe698c-7526-4b95-b49a-5cfee32a97c2) [link to log](https://tgstation13.org/parsed-logs/sybil/data/logs/2024/01/01/round-221465/qdel.txt) --- I have also included some context that I have been using to help track image qdels locally, it might be something you want here. If not I can just revert that part. ## Why It's Good For The Game Should help a ton with lag spikes. ## Changelog :cl: fix: fixes an image hard del code: adds context to image hard dels to make them easier to track /:cl: --- code/datums/datum.dm | 8 ++++++++ code/modules/mob/living/basic/bots/bot_hud.dm | 2 +- code/modules/mob/living/simple_animal/bot/bot.dm | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 5bfd548b64e..07fad7092a3 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -406,3 +406,11 @@ /// Can be called more then once per object, use harddel_deets_dumped to avoid duplicate calls (I am so sorry) /datum/proc/dump_harddel_info() return + +///images are pretty generic, this should help a bit with tracking harddels related to them +/image/dump_harddel_info() + if(harddel_deets_dumped) + return + harddel_deets_dumped = TRUE + return "Image icon: [icon] - icon_state: [icon_state] [loc ? "loc: [loc] ([loc.x],[loc.y],[loc.z])" : ""]" + diff --git a/code/modules/mob/living/basic/bots/bot_hud.dm b/code/modules/mob/living/basic/bots/bot_hud.dm index c4001473f94..cbadab01360 100644 --- a/code/modules/mob/living/basic/bots/bot_hud.dm +++ b/code/modules/mob/living/basic/bots/bot_hud.dm @@ -50,7 +50,7 @@ clear_path_hud() var/list/path_images = active_hud_list[DIAG_PATH_HUD] - QDEL_LIST(path_images) + LAZYCLEARLIST(path_images) var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC_ADVANCED]) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 39ac1fd02e3..22c7439ec80 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -1175,7 +1175,7 @@ Pass a positive integer as an argument to override a bot's default speed. hud.remove_atom_from_hud(src) var/list/path_images = active_hud_list[DIAG_PATH_HUD] - QDEL_LIST(path_images) + LAZYCLEARLIST(path_images) if(length(newpath)) var/mutable_appearance/path_image = new /mutable_appearance() path_image.icon = path_image_icon