From 4c61fb7e5fa2f458ed9373b85e6ffe92434adaf4 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 21 Aug 2024 23:49:49 +0200 Subject: [PATCH] [MIRROR] [NO GBP] Fixing Clarke's ore box the proper way (#29519) * [NO GBP] Fixing Clarke's ore box the proper way (#85954) ## About The Pull Request #85924 did it in a bad way, but I was too hasty and merged it anyway, so it's on my shoulders to rectify that. ## Why It's Good For The Game Code guidelines compliance. ## Changelog N/A * [NO GBP] Fixing Clarke's ore box the proper way --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- code/modules/mining/boulder_processing/boulder.dm | 2 -- code/modules/vehicles/mecha/working/clarke.dm | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/modules/mining/boulder_processing/boulder.dm b/code/modules/mining/boulder_processing/boulder.dm index 64aba6339df..342afe8abe5 100644 --- a/code/modules/mining/boulder_processing/boulder.dm +++ b/code/modules/mining/boulder_processing/boulder.dm @@ -22,8 +22,6 @@ var/boulder_size = BOULDER_SIZE_SMALL /// Used in inheriting the icon_state from our parent vent in update_icon. var/boulder_string = "boulder" - // There is one boulder per boulder (this is required for the Clarke UI as it treats ores and boulders in the same fashion and needs an amount for both) - var/amount = 1 /obj/item/boulder/Initialize(mapload) . = ..() diff --git a/code/modules/vehicles/mecha/working/clarke.dm b/code/modules/vehicles/mecha/working/clarke.dm index e06e578b707..8b0c71b91ca 100644 --- a/code/modules/vehicles/mecha/working/clarke.dm +++ b/code/modules/vehicles/mecha/working/clarke.dm @@ -77,15 +77,19 @@ /obj/item/mecha_parts/mecha_equipment/orebox_manager/get_snowflake_data() var/list/contents = chassis.ore_box?.contents var/list/contents_grouped = list() - for(var/obj/item/stack/ore/item as anything in contents) - if(isnull(contents_grouped[item.name])) + for(var/atom/movable/item as anything in contents) + var/amount = 1 + if(isstack(item)) + var/obj/item/stack/stack = item + amount = stack.amount + if(isnull(contents_grouped[item.icon_state])) var/ore_data = list() ore_data["name"] = item.name ore_data["icon"] = item.icon_state - ore_data["amount"] = item.amount - contents_grouped[item.name] = ore_data + ore_data["amount"] = amount + contents_grouped[item.icon_state] = ore_data else - contents_grouped[item.name]["amount"] += item.amount + contents_grouped[item.icon_state]["amount"] += amount var/list/data = list( "snowflake_id" = MECHA_SNOWFLAKE_ID_OREBOX_MANAGER, "contents" = contents_grouped,