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

Fix Eat menu resetting after consuming food #38366

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

jkraybill
Copy link
Contributor

Summary

SUMMARY: Bugfixes "Fix Eat menu resetting after consuming food"

Purpose of change

Fixes #36884
Fixes #38014

To fix the issue where the (E)at menu resets menu position after consuming items, if the menu has more than one category or has a filter.

Describe the solution

Apparently the inventory just needed an additional call to update() after setting the cached filter, introduced in #37538.

I honestly am not sure exactly what mechanism was causing the filter setting code to disrupt this, I found this solution through trial and error. I think the filter-setting code calling prepare_paging was invalidating the positions that were being set with the later call to select_position.

Describe alternatives you've considered

Continuing to arrange my food in small piles to avoid this very annoying bug.

Testing

Tested the various scenarios that would trigger this bug: multi-position food, filtered eat menu, and tested eating with and without multi-position sources and with and without filters, before and after.

Additional context

The inventory management code being dealt with here is really testing the limits of my abilities. Even though this is a one-line fix I would greatly appreciate some code review.

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. labels Feb 26, 2020
@ZhilkinSerg ZhilkinSerg merged commit 2fd6f5f into CleverRaven:master Feb 26, 2020
@jkraybill jkraybill deleted the 36884b branch March 8, 2020 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'E'at menu doesn't stay open on last item "Consume item" window is reset if a filter was set
2 participants