-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Nonrigid nested container can't store picked up items #62073
Fix Nonrigid nested container can't store picked up items #62073
Conversation
Can't do a full review right now, but it looks like most if not all you're doing there could be done with |
@mqrause Thanks for advice. I would like to go over the code again myself, but it would be even more helpful if you could indicate more specific points( or direction ) of improvement . |
I'll have to look at it a bit closer this weekend, but as a quick and hopefully helpful pointer: |
@mqrause Thanks for useful information. After my earlier post, I have checked myself to see if I could make use of item_location, and have confirmed that it may at least substitute it with a tuple of item_location without using unique_ptr. Now I will seek to simplify it further with the new information you have given me. |
Use item_location instead of unique structure and unique_ptr
Following mqrause's advice, I adopted a style that utilizes Unfortunately, my poor knowledge and skills, have resulted in the generation of code that is not very readable. |
Would you be able to add a test for this case, so we can prevent bugs like this? |
I am interested but it may be difficult for me to make it.
I will try this one quickly. |
Recreate structure using item_location Fix logical bug
Add const and reference modifiers
Changed from individual emplace_back to insert. Suggested by mqrause Co-authored-by: mqrause <[email protected]>
get_child_pocket_with_parent func migrates from outfit scope to Character scope get_child_pocket_with_parent func has new filter and sort function arguments
Suggested by mqrause Erase a redundant line break
Erase dupulicated checks Co-authored-by: mqrause <[email protected]>
Summary
Bugfixes "Nonrigid nested containers can't store picked up items"
Purpose of change
Improved to collect all pockets, even nested non-rigid pockets, and then fill them with items in the order of priority.
Describe the solution
In current codes, nested non-rigid containers did not contain picked up
count_by_charges
items.Improved the method to collect all pockets, even nested non-rigid pockets, calculate capacity limits by the parent-child relationship, and then fill the items based on priority.
Describe alternatives you've considered
None
Testing
In-game testing done.
Repro method by the issue #62068
Additional context
Thanks to @akrieger, his report, which accurately pointed out this problem, struck a chord with my laziness.