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.