New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wielding some containers doesn't preserve their contents #28160

Closed
KongMD-Steam opened this Issue Feb 10, 2019 · 3 comments

Comments

5 participants
@KongMD-Steam
Copy link

KongMD-Steam commented Feb 10, 2019

Describe the bug
Containers that do not have the Resealable flag will have their contents stay on the ground, after wielding them with the Wield command. I believe this is a bug, and the correct behavior happens with the Examine command, which allows the player to wield the container with its contents intact.

The Wield bug does not seem to exist with containers that can be resealed.

To Reproduce

  1. Wield an empty bucket
  2. Put water into the bucket
  3. Drop the bucket on the ground
  4. Use the Wield command to wield the bucket. Observe that the liquid it contained is now on the ground.

Expected behavior
Wielding all containers preserves their contents.

Workaround
Use the Examine command to examine the tile with the container and wield it that way. This correctly preserves container contents.

Versions and configuration(please complete the following information):

  • OS: Windows 8
  • Game Version: 0.C-37392-gc602844
  • Tiles
  • Mods loaded: Many. I'm not sure this matters, but I can provide the list, if this behavior isn't present in vanilla.

Additional context
None

@kevingranade kevingranade added this to Need Confirmation in 0.D Release via automation Feb 13, 2019

@kevingranade kevingranade added this to the 0.D milestone Feb 13, 2019

@aoae23

This comment has been minimized.

Copy link
Contributor

aoae23 commented Feb 16, 2019

I can confirm this bug occurs in vanilla.

@kevingranade kevingranade moved this from Need Confirmation to Confirmed in 0.D Release Feb 16, 2019

@ifreund

This comment has been minimized.

Copy link
Contributor

ifreund commented Feb 17, 2019

Ok, I know what's happening here. When game::wield( item_location ) is called it calls player::wield( item ) in the following line

u.wield( u.i_at( loc.obtain( u ) ) );

loc.obtain( u ) moves the item to the player's inventory, causing item::on_pickup() to be called which spills the contents. Other methods of wielding don't first put the item in the character's inventory, hence the inconsistency.

Should get to fixing this tomorrow.

@kevingranade kevingranade moved this from Confirmed to Confirm Fix in 0.D Release Feb 18, 2019

@kevingranade

This comment has been minimized.

Copy link
Member

kevingranade commented Feb 19, 2019

Fixed by #28248

0.D Release automation moved this from Confirm Fix to Closed Issues Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment