Jump to content

Consistent hard crash when shift+clicking jellyfish from backpack into full chest


Jade_Vanadium
  • DLC VERSION - IMPORTANT!: Shipwrecked, Hamlet Pending

Fill a treasurechest with items, where at least one item is a living jellyfish. Have a second living jellyfish in your backpack, open the chest, and shift+click the second jellyfish a few times. Hard crash, not even an error log. ThisĀ is at least partially due to a typo within the invslot:TradeItem method. Explicitly

In the invslot:TradeItem method, near the end we call
dest:GiveItem(item, nil, nil, nil, true)
Which is correct if dest were an inventory, but if dest is a container then it should instead do
dest:GiveItem(item, nil, nil, false)

In our case, "dest" is the Container component of our treasurechest entity, and "item" is the jellyfish entity in our backpack. The fifth argument there, which is conspicuously set to "true", corresponds to the "skipsound" argument of the Container:GiveItem method. The fourth argument however corresponds to "drop_on_fail", which is reassigned to be true in the case that it's nil. Related to the above code in the invslot:TradeItem method, there's a nearby comment explicitly saying we're meant to not drop on fail here, quote "-- don't drop on fail, since the item may transform on drop (eg a jellyfish)", so definitely an oversight. However, if "dest" happens to be an inventory component, then the fifth argument of the inventory:GiveItem method instead corresponds to "dont_drop_on_fail", which should indeed be true.

In our example, this ultimately results in calling the inventoryitem:OnDropped function for the jellyfish, which is responsible for Remove()ing our backpack jellyfish and spawning a dead one on the floor. Unfortunately, our backpack has separation anxiety and becomes haunted by the ghost of the now-invalid jellyfish, and if we irritateĀ the missingno jelly by repeatedly slamming its face into our chest then it gets angy at wilson and does a K-Class end of the world scenario.

jellyfish_catastrophy_0clicks.pngjellyfish_catastrophy_1click.pngjellyfish_catastrophy_2clicks.png


Steps to Reproduce

1. Get a treasurechest, a backpack, and 10 living jellyfish.
2. Equip the backpack and put one of the jellies in there
3. Fill the chest completely with the other 9 jellies; keep the chest open
4. Shift+click the backpack jellyfish two or three times in quick succession.
5. Game hard crashes.




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...