From 23e7d0d43459262c5469864449a595e5d39751eb Mon Sep 17 00:00:00 2001 From: FebrezeNinja <190972231+FebrezeNinja@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:33:16 -0500 Subject: [PATCH 1/4] Add contraband items to asrs ui_static_data --- code/game/supplyshuttle.dm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 5c3f0e8e121a..1c92c2781eeb 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -1125,6 +1125,31 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) . = ..() .["contraband_categories"] = linked_supply_controller.contraband_supply_groups + for(var/pack_type in GLOB.supply_packs_datums) + var/datum/supply_packs/pack = GLOB.supply_packs_datums[pack_type] + + if(!pack.buyable) + continue + + if(isnull(pack.contains) && isnull(pack.containertype)) + continue + + if(!(pack.group in linked_supply_controller.contraband_supply_groups)) + continue + + var/list_pack = pack.get_list_representation() + + if(length(pack.group)) + if(!.["categories_to_objects"][pack.group]) + .["categories_to_objects"][pack.group] = list() + + .["categories_to_objects"][pack.group] += list( + list_pack + ) + + .["all_items"] += list( + list_pack + ) /obj/structure/machinery/computer/supply/asrs/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() From f657939109a27141ce3ccbda4b94fb0192db48fd Mon Sep 17 00:00:00 2001 From: FebrezeNinja <190972231+FebrezeNinja@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:34:19 -0500 Subject: [PATCH 2/4] unwanted downcast? Caused errors in debug --- code/game/supplyshuttle.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 1c92c2781eeb..2cbf61bd4269 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -407,7 +407,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) /obj/structure/machinery/computer/supply/asrs/proc/toggle_contraband(contraband_enabled = FALSE) can_order_contraband = contraband_enabled - for(var/obj/structure/machinery/computer/supply/asrs/computer as anything in linked_supply_controller.bound_supply_computer_list) + for(var/obj/structure/machinery/computer/supply/asrs/computer in linked_supply_controller.bound_supply_computer_list) if(computer.can_order_contraband) linked_supply_controller.black_market_enabled = TRUE return @@ -417,7 +417,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) /// Prevents use of black market, even if it is otherwise enabled. If any computer has black market locked out, it applies across all of the currently established ones. /obj/structure/machinery/computer/supply/asrs/proc/lock_black_market(market_locked = FALSE) - for(var/obj/structure/machinery/computer/supply/asrs/computer as anything in linked_supply_controller.bound_supply_computer_list) + for(var/obj/structure/machinery/computer/supply/asrs/computer in linked_supply_controller.bound_supply_computer_list) if(market_locked) computer.black_market_lockout = TRUE From be5c173b60beb924040c7538057998192674208d Mon Sep 17 00:00:00 2001 From: FebrezeNinja <190972231+FebrezeNinja@users.noreply.github.com> Date: Sat, 11 Jan 2025 03:10:23 -0500 Subject: [PATCH 3/4] Requested change: have supply handle both --- code/game/supplyshuttle.dm | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 2cbf61bd4269..8ae3ff453c0f 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -204,7 +204,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) if(isnull(pack.contains) && isnull(pack.containertype)) continue - if(!(pack.group in linked_supply_controller.all_supply_groups)) + if(!(pack.group in list() + linked_supply_controller.all_supply_groups + linked_supply_controller.contraband_supply_groups)) continue if(!pack.contraband && length(pack.group)) @@ -1125,31 +1125,6 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) . = ..() .["contraband_categories"] = linked_supply_controller.contraband_supply_groups - for(var/pack_type in GLOB.supply_packs_datums) - var/datum/supply_packs/pack = GLOB.supply_packs_datums[pack_type] - - if(!pack.buyable) - continue - - if(isnull(pack.contains) && isnull(pack.containertype)) - continue - - if(!(pack.group in linked_supply_controller.contraband_supply_groups)) - continue - - var/list_pack = pack.get_list_representation() - - if(length(pack.group)) - if(!.["categories_to_objects"][pack.group]) - .["categories_to_objects"][pack.group] = list() - - .["categories_to_objects"][pack.group] += list( - list_pack - ) - - .["all_items"] += list( - list_pack - ) /obj/structure/machinery/computer/supply/asrs/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() From ec37b0e1d4d1428406dc8e5808ddc048eed1773d Mon Sep 17 00:00:00 2001 From: FebrezeNinja <190972231+FebrezeNinja@users.noreply.github.com> Date: Sat, 11 Jan 2025 03:15:02 -0500 Subject: [PATCH 4/4] Lint fix --- code/game/supplyshuttle.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 8ae3ff453c0f..5066866e6028 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -204,7 +204,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) if(isnull(pack.contains) && isnull(pack.containertype)) continue - if(!(pack.group in list() + linked_supply_controller.all_supply_groups + linked_supply_controller.contraband_supply_groups)) + if(!(pack.group in (list() + linked_supply_controller.all_supply_groups + linked_supply_controller.contraband_supply_groups))) continue if(!pack.contraband && length(pack.group))