mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Big storage containers (like bags) in smaller ones (like boxes) can't have items placed in them (#46983)
* Bags in boxes can't have items placed in them Untested webedit Fixes https://github.com/tgstation/tgstation/issues/46345 * smooths a redundant check * more squishing
This commit is contained in:
@@ -614,6 +614,11 @@
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[I] is too big for [host]!</span>")
|
||||
return FALSE
|
||||
var/datum/component/storage/biggerfish = real_location.loc.GetComponent(/datum/component/storage)
|
||||
if(biggerfish && biggerfish.max_w_class < max_w_class)//return false if we are inside of another container, and that container has a smaller max_w_class than us (like if we're a bag in a box)
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[I] can't fit in [host] while [real_location.loc] is in the way!</span>")
|
||||
return FALSE
|
||||
var/sum_w_class = I.w_class
|
||||
for(var/obj/item/_I in real_location)
|
||||
sum_w_class += _I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
|
||||
|
||||
Reference in New Issue
Block a user