Steals and fixes a memory leak fix from the freeloaders

-Up-ports a memory leak fix related to preview mannequins.
-Also fixes the forementioned fix breaking fuzzy/sharp previews on setup.
-Also makes the fuzzy/sharp toggle button update the char setup preview.
This commit is contained in:
Verkister
2021-02-27 12:47:16 +02:00
parent 96115d20fd
commit 4ea4eecf28
3 changed files with 11 additions and 9 deletions
+7 -7
View File
@@ -94,13 +94,13 @@ var/global/list/string_slot_flags = list(
"holster" = SLOT_HOLSTER
)
/proc/get_mannequin(var/ckey)
if(!mannequins_)
mannequins_ = new()
. = mannequins_[ckey]
if(!.)
. = new/mob/living/carbon/human/dummy/mannequin()
mannequins_[ckey] = .
GLOBAL_LIST_EMPTY(mannequins)
/proc/get_mannequin(var/ckey = "NULL")
var/mob/living/carbon/human/dummy/mannequin/M = GLOB.mannequins[ckey]
if(!istype(M))
GLOB.mannequins[ckey] = new /mob/living/carbon/human/dummy/mannequin(null)
M = GLOB.mannequins[ckey]
return M
//////////////////////////
/////Initial Building/////