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 invalidation of soft container nested in a holster #72417

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

wwkk222208
Copy link
Contributor

@wwkk222208 wwkk222208 commented Mar 16, 2024

Summary

None

Purpose of change

There is a bug:
When picking up items, players can't put them into a soft container nested in a holster. (Players are not likely to do this in vallina DDA, but it will happen when using ‘lifting field’ of MindOverMatter). In addition, when the soft container is placed in a holster, the available capacity of the player will also be underestimated.
This PR is to solve it.

Describe the solution

1.Ignore regidity of nested pocket if current pocket is a holster.
2.If a pocket is a holster with an item, use the volume of contents when it is full as the pocket capacity. For non-container or rigid container, it is the volume of itself. For soft container it will add all of the remaining volume of soft valid pocket.

Describe alternatives you've considered

A soft holster nested in another one is not considered, which will lead to higher capacity showed on the UI. To obtain accurate results, a recursive function may be required. Since in the actual game this is very rare, from a performance perspective, it seems not worth it to do so.
Even if you do want to try that, it won't lead to worse results. Instead, if the result is lower than the actual, it will prevent you from picking up items normally.

Testing

Tested in game.

Additional context

Codes of nested container are really complicated!!

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Info / User Interface Game - player communication, menus, etc. labels Mar 16, 2024
@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Items: Containers Things that hold other things Mods: Mind Over Matter astyled astyled PR, label is assigned by github actions labels Mar 16, 2024
@wwkk222208 wwkk222208 marked this pull request as ready for review March 16, 2024 06:33
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-requesting reviews from non-collaborators: @Standing-Storm

@wwkk222208 wwkk222208 changed the title Fix iussues of soft container nested in a holster Fix invalidation of soft container nested in a holster Mar 16, 2024
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 16, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Mar 16, 2024
@wwkk222208
Copy link
Contributor Author

Thanks to SurFlurer for helping me complete this work!

@kevingranade kevingranade merged commit 819fc4f into CleverRaven:master Mar 20, 2024
21 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. Items: Containers Things that hold other things [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mods: Mind Over Matter Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants