From e112fd4c27f4bb6289363dda024d054db280afa0 Mon Sep 17 00:00:00 2001 From: "aranclanos@hotmail.com" Date: Sun, 24 Feb 2013 16:01:46 +0000 Subject: [PATCH] Images from security and medical HUDs (glasses/borg/odysseus) will now be garbage collected instead of being manually deleted. Because of this, borgs will no longer save all the images on their client, avoiding the display of thousands of HUD images on a single mob, lagging or crashing the player's client. If I'm right, this will reduce 90% of the del() lag. Cross your fingers! git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5773 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index b4ee5e923f7..dbfcb96fe6a 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -932,7 +932,7 @@ for(var/image/hud in client.images) if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe - del(hud) + client.images.Remove(hud) client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 650a16c28ae..673ed7723fb 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -161,6 +161,10 @@ src.see_in_dark = 8 src.see_invisible = SEE_INVISIBLE_LEVEL_TWO + for(var/image/hud in client.images) + if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe + client.images.Remove(hud) + var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src) if(hud && hud.hud) hud.hud.process_hud(src)