CleverRaven / Cataclysm-DDA

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

Deploying brazier over spilled liquid and moving the brazier moves the spilled liquid #45535

Open Deiskos opened 3 years ago

Deiskos commented 3 years ago

Describe the bug

Deploying brazier over spilled liquid and moving the brazier also moves the spilled liquid. Moving the brazier over the spilled liquid destroys the liquid.

Steps To Reproduce

  1. Spill the liquid.
  2. Deploy brazier onto the same tile.
  3. Grab the brazier and move it somewhere.

Expected behavior

Spilled liquid stays on the same tile. Spilled liquid doesn't disappear.

Screenshots

Spill image

Deploy image

Move image

Versions and configuration

Also reproducible on latest experimental:

Night-Pryanik commented 3 years ago

Moving furniture over spilled liquids and destroying them in the process isn't a bug, it's working as intended, see #29921.

Deiskos commented 3 years ago

OK, but moving liquid after it's spilled by deploying a thing on top of it is definitely a bug.

wapcaplet commented 3 years ago

Confirmed in 0.E-7641-g1e0c90ea69. Here I have 200 L of water spilled on the ground:

image

I can deploy a brazier on top of the water, then drag it around - the water moves with it:

image

image

image

Not only liquids are affected; it appears to work for any pile of items in the tile where the brazier is deployed.

sacrificerXY commented 3 years ago

This also works for some other furnitures such as: ovens, refrigerators, deployed fire barrel, wooden crates, cardboard boxes, etc... They all have at least one of these flags: CONTAINER, FIRE_CONTAINER, or SEALED. (I'll use the term container to refer to these types of items.)

When you grab-move containers, they collect all the items in its path like how hauling would (can spill if too full). I think this part is inteded behavior. I could imagine the character clearing the destination tile and then putting the items back after moving. Or putting the items into the furniture first then moving.

When you deploy containers on top of other items, they also collect those items when moving, including liquids.

A general fix could be to destroy all spilled liquids on the tile where the container is, regardless if it was just deployed or after moving. It already does this when moving into tiles which only contains liquids. Though what should happen when liquid is poured on top of it?

Relevant code: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/game.cpp#L10226

int-ua commented 3 years ago

I don't see how this could be exploited, please comment if it could.