Jump to content

Containers sometimes leave items hanging around origin


Jade_Vanadium
  • DLC VERSION - IMPORTANT!: Vanilla - NO DLC, Reign of Giants, Shipwrecked, Hamlet Pending
  • If an ingredient is placed in a crockpot and then rots, then the spoiled food hangs around the origin
  • If a medium fish (dogfish, swordfish) is placed in an icebox and then rots, then the spoiled fish hangs around the origin
  • If a doydoy is on a full shelf (Hamlet) and then starves, most of its loot (feathers, drumsticks) hangs around the world origin
  • If you open a shelf with controller, fill 5/6 slots with coconuts and keep the last slot empty, and then switch to mouse to use a machete to hack a shelfed nut, then a half nut hangs around the origin

The common thread between these bugs is that the Container:GiveItem method inappropriately refuses to drop on fail even when the drop_on_fail parameter is specifically set to true (or if it's set to nil, which is meant to default to true). The above scenarios are attributable to the following two issues.

  • The GiveItem method begins by immediately calling CanTakeItemInSlot, but if that returns false then nothing happens and the item doesn't get dropped. This happens in the first 3 scenarios above.
  • If you try to put a stack into an empty slot of a non-stacking container, then GiveItem fills one slot with one item but then returns false while unilaterally refusing to drop the rest of the items. This happens in the last scenario above, with coconuts on shelves.

I scoured the files for every case where the Container:GiveItem method was called, and I'm fairly certain that in every case we expect it to drop on fail unless specifically told not to. Certainly that's the expectation in the four examples I found, and we get weird behavior since GiveItem isn't doing what it's supposed to.

doydoy_shelf1.png

doydoy_shelf2.png

doydoy_shelf3.png

doydoy_shelf4.png

crockpot_spoilage1.png

crockpot_spoilage2.png


Steps to Reproduce

For crockpot bug:

  1. Place practically any ingredients into the crockpot container slots (don't cook!)
  2. Wait until the ingredients rot
  3. The spoiled food / spoiled fish / rotten egg is now at the world origin

For the icebox bug:

  1. Place dogfish or dead swordfish into icebox
  2. Wait until it rots
  3. Spoiled fish is now at the world origin

For the doydoy bug:

  1. Get a doydoy and place it on a shelf
  2. Fill the rest of the shelf slots with items.
  3. Wait for the doydoy to starve to death
  4. One loot gets put on the shelf in place of the doydoy, but the other four loot items are now at the world origin

For the coconut bug:

  1. Get a shelf, a machete, and 5 coconuts
  2. Place all coconuts on the shelf
  3. Enable controller, and open the shelf container UI
  4. Disable controller; switch back to mouse (this doesn't close the container UI)
  5. Use the machete to hack one of the coconuts in the container UI
  6. Half nut is now at the world origin.



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...