CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
9.95k stars 4.08k forks source link

AIM: incorrect weight after moving a plastic chunk #74408

Open Brambor opened 3 weeks ago

Brambor commented 3 weeks ago

Describe the bug

I moved a plastic chunk into inventory. The weight carried went from 41 kg to 39.9 kg.

Attach save file

Winter Beach-trimmed.tar.gz

Steps to reproduce

  1. Load save.
  2. / Open AIM.
  3. Move a single plastic chunk from ALL tiles into inventory.
  4. Observe: The weight carried went from 41kg to 39.9 kg.

Expected behavior

Weight is up to date.

Moving items into inventory increases the weight carried, not decreases it.

Screenshots

No response

Versions and configuration

Master was 5d0da40857

Additional context

Unlike #73337 this breaks with item that isn't counted by charges.

PatrikLundell commented 3 weeks ago

Are you sure the starting weight is correct? The reason I ask is because there are (were?) cases where changing inventory contents did not update the weight until the next tick.

Brambor commented 3 weeks ago

I am not sure. However, the bug is easily reproducible in the save. You can move plastic chunks back and forth and it will be broken.