From 36ab4d8e5c96ab3fb14222531d9bb8dc1fba5c22 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sun, 6 Feb 2022 18:15:22 -0500 Subject: [PATCH] The final Item Bank patch? Adds a few more restrictions, adds a confirmation prompt that warns about potential loss of contents, and checks contents for prohibited items. --- code/datums/vending/stored_item.dm | 5 +++++ code/modules/client/stored_item.dm | 11 +++++++++++ .../mining/ore_redemption_machine/equipment_vendor.dm | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/code/datums/vending/stored_item.dm b/code/datums/vending/stored_item.dm index 82a3d087c9..0bf1c6bd5f 100644 --- a/code/datums/vending/stored_item.dm +++ b/code/datums/vending/stored_item.dm @@ -42,6 +42,11 @@ var/atom/movable/product = instances[instances.len] // Remove the last added product instances -= product product.forceMove(product_location) + //VOREStation Addition Start + if(istype(product, /obj)) + var/obj/item = product + item.persist_storable = FALSE + //VOREStation Addition End return product /datum/stored_item/proc/add_product(var/atom/movable/product) diff --git a/code/modules/client/stored_item.dm b/code/modules/client/stored_item.dm index c64cea7507..1396f445c2 100644 --- a/code/modules/client/stored_item.dm +++ b/code/modules/client/stored_item.dm @@ -134,6 +134,15 @@ to_chat(user, "You cannot store \the [O]. You already have something stored.") busy_bank = FALSE return + var/choice = tgui_alert(user, "If you store \the [O], anything it contains may be lost to \the [src]. Are you sure?", "[src]", list("Store", "Cancel"), timeout = 10 SECONDS) + if(!choice || choice == "Cancel" || !Adjacent(user) || inoperable() || panel_open) + busy_bank = FALSE + return + for(var/obj/check in O.contents) + if(!check.persist_storable) + to_chat(user, "\The [src] buzzes. \The [O] contains [check], which cannot be stored. Please remove this item before attempting to store \the [O]. As a reminder, any contents of \the [O] will be lost if you store it with contents.") + busy_bank = FALSE + return user.visible_message("\The [user] begins storing \the [O] in \the [src].","You begin storing \the [O] in \the [src].") icon_state = "item_bank_o" if(!do_after(user, 10 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) || inoperable()) @@ -217,4 +226,6 @@ persist_storable = FALSE /obj/item/weapon/gun/energy/sizegun/abductor persist_storable = FALSE +/obj/item/stack + persist_storable = FALSE diff --git a/code/modules/mining/ore_redemption_machine/equipment_vendor.dm b/code/modules/mining/ore_redemption_machine/equipment_vendor.dm index 1146d123eb..c100a7a9bc 100644 --- a/code/modules/mining/ore_redemption_machine/equipment_vendor.dm +++ b/code/modules/mining/ore_redemption_machine/equipment_vendor.dm @@ -287,7 +287,10 @@ return remove_points(inserted_id, prize.cost) - new prize.equipment_path(loc) + //VOREStation Edit Start + var/obj/I = new prize.equipment_path(loc) + I.persist_storable = FALSE + //VOREStation Edit End flick(icon_vend, src) //VOREStation Add else flick(icon_deny, src) //VOREStation Add