Change setting item weight class to a setter to patch some weight class related shenanigans (#82494)

## About The Pull Request

Fixes #81052 
Fixes #58008

Setting weight class of items is now done via `update_weight_class`.

I updated as many occurrences of manually setting `w_class` as I could
find but I may have missed some. Let me know if you know of any I
missed.

This is done to allow datums to react to an item having its weight class
changed.

Humans and atom storage are two such datums which now react to having an
item in its contents change weight class, to allow it to expel items
that grow to a weight class beyond what is normally allowed.

## Changelog

🆑 Melbert
fix: You can't fit items which are normally too large for a storage by
fitting it in the storage when it is small, then growing it to a larger
size.
/🆑
This commit is contained in:
MrMelbert
2024-04-08 19:01:30 -06:00
committed by GitHub
parent 5fbfd2447a
commit 0dc6b71a87
28 changed files with 127 additions and 58 deletions
@@ -104,12 +104,12 @@
if(screen_on)
to_chat(user, span_notice("You close \the [src]."))
slowdown = initial(slowdown)
w_class = initial(w_class)
update_weight_class(initial(w_class))
drag_slowdown = initial(drag_slowdown)
else
to_chat(user, span_notice("You open \the [src]."))
slowdown = slowdown_open
w_class = w_class_open
update_weight_class(w_class_open)
drag_slowdown = slowdown_open
if(isliving(loc))
var/mob/living/localmob = loc