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

Remove duplicate stealing code (CleverRaven#36596) #35

Merged
merged 36 commits into from
Jan 2, 2020

Conversation

fengjixuchui
Copy link
Owner

Summary

Purpose of change

Describe the solution

Describe alternatives you've considered

Testing

Additional context

John-Candlebury and others added 30 commits December 17, 2019 22:23
Co-Authored-By: Anton Burmistrov <[email protected]>
Co-Authored-By: BevapDin <[email protected]>
Previously the in-game lunar month was exactly one third of a season
(30.333 days, by default).  This meant that the lunar cycle matched
perfectly with the seasons / years, unlike the real-world lunar cycle
which is inconveniently mismatched with other calendar units.

Switch it so that, for the default season length, the lunar cycle
matches the real-world synodic month of about 29.5 days.

Also tidy up the code so that it's clearer how this value is arrived at.
Pull these values out as global statics to make it clearer that the
default season length is the real-world season length.
This was failing on Mingw, probably due to -ffast-math optimizations.
This was already theoretically implemented, but it didn't work.  Fix it
and add a test.
This one is in Catch2 internals and triggered by using generators.
To deal with the long-standing issue of accidentally using rotting food
in crafting (especially when crafting a large batch) and thus wasting
time and materials.

Allow a recipe filter to exclude rotten components.

Use this new feature when selecting items for crafting to prefer
non-rotten ones.  When non-rotten ones do not suffice, warn the player
of this fact before proceeding.

In the crafting GUI, mark crafts in brown when they can only be crafted
with rotten ingredients.

If the result doesn't care about rottenness, as with e.g. lamp oil, then
no warnings or marking of the recipes is done.

This only catches the case where the ingredients are rotten when you
start the craft.  There is also the situation where things start
non-rotten, but become rotten while you craft.  This change does not
attempt to handle that, but it could now be handled by a localized
change in recipe::get_component_filter.
* Leech-pod-monster family

* Fix typo

* Apply suggestions from code review

Co-Authored-By: Anton Burmistrov <[email protected]>
Co-Authored-By: BevapDin <[email protected]>

* Follow through suggestions

* Reword alien frond description

* Correct monattack logic

* Finalize leech pod monster family

Co-authored-by: Anton Burmistrov <[email protected]>
Co-authored-by: BevapDin <[email protected]>
This reduces the overhead for non-craft items to a single pointer.
LilShiningMan and others added 6 commits January 2, 2020 07:56
Granularized main alcohol groups, eliminated redundant lists in various item groups.
Fixes #34046.

Using the search filter causes all the inventory_entry objects to be
recreated, so it's not safe to store a pointer to them.

A previous attempt to solve this (#36139) stored copies of the
inventory_entry objects, but that was also unsafe.

This attempt instead stores just pointers to the underlying items.  This
seems to prevent the crashes.

The behaviour of the window is still not always exactly correct, because
using the filter will violate the invariant that the items in the
compared vector correspond to the selected entries.  I don't see a way
to fix that in general -- sometimes the compared item is filtered out,
and thus you can't possibly select the entry (because it doesn't exist).
We might want to add something that does its best to select the right
entries when the filter changes, but this is a sufficiently niche use
case that I'm not sure it's worth the complexity.  I've settled for just
fixing the crash for now.
Detect and warn about crafting with rotten food
@fengjixuchui fengjixuchui merged commit b8a4527 into fengjixuchui:master Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.