Anyway, I'm going to try my hand at coding in Byond again, and this time for a apparently "harmless" Quality of Life feature : transfering the contents of one container to the other.
The basic idea is this :
Click and Drag your Storage item (Bag/Satchel/RPED) to dump the its contents into :
- Another Container
A Disposal Bin
A Not-Walled Turf
Apparently the place to do this is the MouseOver() proc in storage.dm, at least I think.
TO DO:
In MouserOver(over_object)
Check for adjacence
Istype pour 3 cases :
- Container : Special ContentsToContainer(over_object, mob/user)
Bin : No need for extra checks, ContentsTo(over_object, mob/user)
Default (It case of dropping over another item not made for that) : get_turf(over_object), check if turf isn't walled, ContentsTo(turf, mob/user)
New Proc : ContentsTo(over_object, mob/user)
For (item in contents), transfer items to over_object
(There shouldn't be needs for any checks, turfs and bins can hold unlimited amounts of any items)
New Proc : ContentsToContainer(over_object, mob/user)
For (item in contents)
- Check if Container isn't full
Check if that weight item weight class can go in container
Check if container can hold that part (case of satchel and RPED)
transfer item to over_object
I hope I didn't forget any edge cases.Sounds simple enough, right?
Prepare for unforeseen consequences
EDIT : And yes, that way you actually can check a bag content without triggering that pesky mousetrap.
EDIT2 : Humanity and drone Check is already done in MouseOver, so there's no problem there either.