Merge pull request #31765 from DaxDupont/fancythis

Fixed fancy boxes not showing proper content amount.
This commit is contained in:
Jordan Brown
2017-10-16 08:13:45 -04:00
committed by CitadelStationBot
parent d766664253
commit 98fb887ccc
+5 -8
View File
@@ -27,10 +27,9 @@
for(var/i = 1 to storage_slots)
new spawn_type(src)
/obj/item/storage/fancy/update_icon(itemremoved = 0)
/obj/item/storage/fancy/update_icon()
if(fancy_open)
var/total_contents = src.contents.len - itemremoved
icon_state = "[icon_type]box[total_contents]"
icon_state = "[icon_type]box[contents.len]"
else
icon_state = "[icon_type]box"
@@ -38,9 +37,9 @@
..()
if(fancy_open)
if(contents.len == 1)
to_chat(user, "There is one [src.icon_type] left.")
to_chat(user, "There is one [icon_type] left.")
else
to_chat(user, "There are [contents.len <= 0 ? "no" : "[src.contents.len]"] [src.icon_type]s left.")
to_chat(user, "There are [contents.len <= 0 ? "no" : "[contents.len]"] [icon_type]s left.")
/obj/item/storage/fancy/attack_self(mob/user)
fancy_open = !fancy_open
@@ -58,9 +57,7 @@
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
fancy_open = TRUE
. = ..()
//Recall update icon with the fancy item snowflake arg (ugh)
update_icon(1)
return ..()
/*
* Donut Box