Skip to content
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

Rot away items inside reality bubble #39822

Merged
merged 20 commits into from
Apr 26, 2020
Merged

Conversation

Hirmuolio
Copy link
Contributor

@Hirmuolio Hirmuolio commented Apr 22, 2020

Summary

SUMMARY: Features "Rot away items away in reality bubble"

Purpose of change

Items rot away (are removed) when they have 2x shelf life of rot.

This check is done only when the item is loaded into reality bubble. So if you stay in same place items do not rot away.

It would be better for the rotting away to be done on items that are inside reality bubble.

Describe the solution

Check for item removal due to rot during normal rot calculations and remove the item (return true) if it has rotten away.

process_temperature_rot needs to know if the item is inside sealed container (those do not rot away). So a new boolean seals is passed around into the functions.

Items that are carried by someone are never removed. It could be a bit confusing for items to disappear from your inventory. Also would cause issues if the item was supposed to spawn some monster when it rots away (eggs).

Also adds a test for item inside reality bubble rotting away.

Describe alternatives you've considered

The check for item rotting on map load could be removed. But the item processing on map load is useful so it should stay in some form at least.

Testing

Spawn food, drop it on ground and wait. The food will despawn once it has 2x of its shelf life worth of rot.

Do same with eggs. A bird will spawn on the spot where the egg was.

Additional context

It can take several tens of seconds for the chicken to spawn after the egg despawns. Some quirk of monster spawning.

Item despawning inside reality bubble will generate bunch of errors


 DEBUG    : Tried removing item from object which did not contain it

 FUNCTION : remove_item
 FILE     : D:\programming stuff\Cataclysm-DDA\src\visitable.cpp
 LINE     : 531

I do not believe this error has anything to do with this feature. This error appears always when a processed item is despawned (for example zombie revives). See issues #39402 and #39451.

@Hirmuolio Hirmuolio changed the title Rot items inside reality bubble Rot away items inside reality bubble Apr 22, 2020
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics labels Apr 23, 2020
@enaantd
Copy link
Contributor

enaantd commented Apr 25, 2020

a bit late to the party, but an alternative would be to leave nonperishable parts (e.g. bones) behind instead of nothing. I'm not sure how it would affect performance and how useful it would be, but it could be interesting to have streets filled with skeletons months into the cataclysm

@anothersimulacrum
Copy link
Member

That's out of scope here. This is only extending an existing behavior to happen in the reality bubble, that's a new feature.

@kevingranade kevingranade merged commit 4ac15ac into CleverRaven:master Apr 26, 2020
Drewscriver pushed a commit to Drewscriver/Cataclysm-DDA that referenced this pull request Apr 30, 2020
@Hirmuolio Hirmuolio deleted the rotting branch May 5, 2020 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants