space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.71k stars 3.4k forks source link

Backpack cake overfill bug #14753

Open MrBirdmann opened 1 year ago

MrBirdmann commented 1 year ago

Found a way to fill a backpack over its maximum capacity.

Reproduction:

Don't know how the underlying mechanics of this work but it seems that increasing the cake's size to match the sum of the slices would prevent this from happening.

juliangiebel commented 1 year ago

The size of the cake and the sum of the slices should probably match yea

hsagerer commented 1 year ago

I'd like to tackle this if possible. I was unable to recreate the bug exactly, as I couldn't get a box into a backpack. What box were you using exactly, and what backpack? The sizes weren't working out.

My first idea of a fix was to increase the size of a cake to 25, and have it reduce in size by 5 every time a slice is taken from it.

hsagerer commented 1 year ago

I've adjusted the cake to have a size of 25, which makes it so it has the same size as the sum of all slices. This does not seem to fix the underlying bug fully, but is a start. I tried to implement having the cake reduce in size as slices are taken, which works, but this introduces a new bug where the size is not updated if you slice the cake in a backpack.

deltanedas commented 1 year ago

thats not really a new bug its pretty old and happens to a few things, including headsets

hsagerer commented 1 year ago

This pull request fixes the issue where cake and cake slices do not add to the same amount, and includes commented out code for decreasing the size of a sliceable food when it is sliced. This issue is partially fixed, but the code for decrementing size could still be added with further testing.

deltanedas commented 1 year ago

somewhat related to wire stack size increasing/decreasing the item size