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

Fixed spawning fresh food instead of spoiled after passing long time #23881

Merged
merged 1 commit into from May 30, 2018

Conversation

Projects
None yet
3 participants
@Firestorm01X2
Copy link
Contributor

commented May 28, 2018

Fix to:
#22308
Players may notice that some time after passing even year they may be able to find fresh food in houses.
It was bug. Food creation date was set to "discovered" turn instead of start of the apocalypse in some cases.

#22308 (comment)

Some mapgen code uses calendar::turn as birthday of spawned items (for example jmapgen_liquid_item or jmapgen_loot). Those items are created at the current turn and are therefor considered fresh. Mapgen should create items with birthday calendar::time_of_cataclysm.

Note that the default for new items is the current turn, but the default for items created via map::spawn_item and similar is time_of_cataclysm. Also: mapgen should have a turn parameter that dictates which turn to use as birthday, but it's not forwarded correctly all the time.

Fix is simple: corrected item birthday to correct date - time of apocalypse.

For now it was done for:

jmapgen_loot
jmapgen_liquid_item
vehicle::place_spawn_items

I hope that is enough for fixing food.

Fixing food spawning fresh instead of spoiled
Fixing food spawning fresh instead of spoiled

@Firestorm01X2 Firestorm01X2 changed the title Fixed spawning fresh food instead of spoiled after passing long time [CR] Fixed spawning fresh food instead of spoiled after passing long time May 28, 2018

@Firestorm01X2 Firestorm01X2 changed the title [CR] Fixed spawning fresh food instead of spoiled after passing long time [CR] [WIP] Fixed spawning fresh food instead of spoiled after passing long time May 28, 2018

@Firestorm01X2

This comment has been minimized.

Copy link
Contributor Author

commented May 28, 2018

Also I don't undertstaind - is there really any reason to set to birthday during mapgen to something different than calendar::time_of_cataclysm?

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented May 28, 2018

Also I don't undertstaind - is there really any reson to set to birthday during mapgen something different from calendar::time_of_cataclysm?

I would say it should be jsonized with default value set to calendar::time_of_cataclysm. Different values could be used for NPC-infested facilities (e.g. bandit camps).

@Firestorm01X2 Firestorm01X2 changed the title [CR] [WIP] Fixed spawning fresh food instead of spoiled after passing long time Fixed spawning fresh food instead of spoiled after passing long time May 28, 2018

@Firestorm01X2

This comment has been minimized.

Copy link
Contributor Author

commented May 28, 2018

Ok. I've tested it. Now I can't find non canned fresh food in houses in "Next Summer" scenario. Fix itself is pretty simple.

Ready fo review.

@Firestorm01X2

This comment has been minimized.

Copy link
Contributor Author

commented May 28, 2018

I would say it should be jsonized with default value set to calendar::time_of_cataclysm. Different values could be used for NPC-infested facilities (e.g. bandit camps).

Probably. But as bugfix it should be good enough for now.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented May 28, 2018

Probably. But as bugfix it should be good enough for now.

Agree.

@kevingranade kevingranade merged commit fe447a1 into CleverRaven:master May 30, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.05%) to 23.602%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.