From 5ef12615a323ae8c60c79b77637f58c7b668c96e Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 18 Aug 2023 21:00:38 +0200 Subject: [PATCH] small fix --- code/game/objects/items/storage/storage.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index f2651023222e..5a6b7d2b9b05 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -377,12 +377,12 @@ var/list/global/item_storage_box_cache = list() return ///Returns TRUE if there is room for the given item. W_class_override allows checking for just a generic W_class, meant for checking shotgun handfuls without having to spawn and delete one just to check. -/obj/item/storage/proc/has_room(obj/item/W as obj, W_class_override = null) +/obj/item/storage/proc/has_room(obj/item/new_item, W_class_override = null) if(storage_slots != null && contents.len < storage_slots) return TRUE //At least one open slot. //calculate storage space only for containers that don't have slots if (storage_slots == null) - var/sum_storage_cost = W_class_override ? W_class_override : W.get_storage_cost() //Takes the override if there is one, the given item otherwise. + var/sum_storage_cost = W_class_override ? W_class_override : new_item.get_storage_cost() //Takes the override if there is one, the given item otherwise. for(var/obj/item/I in contents) sum_storage_cost += I.get_storage_cost() //Adds up the combined storage costs which will be in the storage item if the item is added to it.