fixes fancy boxes not updating icon on init (#9618)

This commit is contained in:
Wowzewow (Wezzy)
2020-08-06 17:43:57 +08:00
committed by GitHub
parent 8090eee55f
commit a9c018c30d
2 changed files with 43 additions and 2 deletions

View File

@@ -30,6 +30,7 @@
/obj/item/storage/box/fancy/Initialize()
. = ..()
update_icon()
if(closable)
desc_info += "Alt-click to open and close the box. " //aka force override icon state. for you know, style.
@@ -46,8 +47,7 @@
/obj/item/storage/box/fancy/update_icon(var/itemremoved = 0)
if(opened) //use the open icon.
if(icon_overlays) //whether it uses the overlays/uses its own version.
var/total_contents = src.contents.len - itemremoved
src.icon_state = "[src.icon_type][src.storage_type][total_contents]"
src.icon_state = "[src.icon_type][src.storage_type][contents.len - itemremoved]"
else
icon_state = "[initial(icon_state)][src.opened]"