mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Merge pull request #5927 from CHOMPStation2/upstream-merge-14681
[MIRROR] [MIRROR] Sheet storage has different caps per type.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/obj/machinery/smartfridge/sheets //Is this used anywhere? It's not secure.
|
||||
/obj/machinery/smartfridge/sheets
|
||||
name = "\improper Smart Sheet Storage"
|
||||
desc = "A storage unit for metals."
|
||||
icon_contents = "boxes"
|
||||
@@ -27,6 +27,6 @@
|
||||
|
||||
/obj/machinery/smartfridge/sheets/find_record(var/obj/item/O)
|
||||
for(var/datum/stored_item/stack/I as anything in item_records)
|
||||
if(istype(O, I.item_path)) // Typecheck should evaluate material-specific subtype
|
||||
if(O.type == I.item_path) // Typecheck should evaluate material-specific subtype
|
||||
return I
|
||||
return null
|
||||
|
||||
@@ -32,6 +32,20 @@
|
||||
max_storage = 250
|
||||
stacks_go_missing = TRUE
|
||||
|
||||
/datum/persistent/storage/smartfridge/sheet_storage/variable_max
|
||||
name = "variable max storage"
|
||||
max_storage = list(
|
||||
/obj/item/stack/material/steel = 150,
|
||||
/obj/item/stack/material/glass = 150,
|
||||
/obj/item/stack/material/copper = 150,
|
||||
/obj/item/stack/material/wood = 150,
|
||||
/obj/item/stack/material/plastic = 150,
|
||||
/obj/item/stack/material/phoron = 100,
|
||||
/obj/item/stack/material/plasteel = 50,
|
||||
/obj/item/stack/material/cardboard = 50,
|
||||
"default" = 10
|
||||
)
|
||||
|
||||
/datum/persistent/storage/smartfridge/sheet_storage/generate_items(var/list/L)
|
||||
. = list()
|
||||
for(var/obj/item/stack/material/S as anything in L)
|
||||
|
||||
@@ -28,6 +28,12 @@
|
||||
var/list/item_list = get_storage_list(entry)
|
||||
var/list/storage_list = list()
|
||||
for(var/item in item_list)
|
||||
if(islist(max_storage))
|
||||
if(!is_path_in_list(item, stored))
|
||||
stored[item] = stored["default"]
|
||||
storage_list[item] = min(stored[item], storage_list[item] + item_list[item]) // Can't store more than max_storage
|
||||
|
||||
else
|
||||
storage_list[item] = min(stored, storage_list[item] + item_list[item]) // Can't store more than max_storage
|
||||
|
||||
// stored gets reduced by qty stored, if greater than stored,
|
||||
|
||||
Reference in New Issue
Block a user