Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien committed Aug 18, 2023
1 parent b258d59 commit 5ef1261
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/game/objects/items/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 5ef1261

Please sign in to comment.