Closed Paneedah closed 5 months ago
The changes made primarily focus on improving the item handling and state management within the weapon and magazine reload functionalities of a Java-based weapon library. An unused string related to inventory management was also removed, reflecting an adjustment in how inventory full situations are handled, now opting to drop items instead of logging errors.
Files | Summary |
---|---|
.../weaponlib/MagazineReloadAspect.java |
Added an empty line for readability before accessing magazineStack . |
.../weaponlib/WeaponAttachmentAspect.java |
- Added conditional check for inventory before adding item. - Reorganized parameters in removeAttachment method. |
.../mwc/lang/en_US.lang .../mwc/lang/es_ES.lang .../mwc/lang/pt_BR.lang .../mwc/lang/tr_TR.lang .../mwc/lang/zh_CN.lang |
Removed the translation for "gui.inventoryFull" in respective language files, affecting the display of the inventory full message. |
Objective | Addressed | Explanation |
---|---|---|
Prevent item loss when inventory is full during magazine change (#372) | โ | |
Ensure readability and maintainability of item handling code (#372) | โ | |
Remove unnecessary UI elements related to full inventory (#372) | โ |
The changes made directly address the core issue of item loss when the inventory is full, as outlined in issue #372, by altering the behavior to drop items instead of potentially losing them. Additionally, the removal of unused UI strings related to inventory being full aligns with the new approach taken in handling full inventory scenarios. The refactoring and cleanup of code not only aim at resolving the specific bug but also enhance the overall code quality and maintainability.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
๐ Description
This is a hotfix for multiple places where items will destroy themselves if the inventory is full.
๐ฏ Goals
The goal of this PR is to prevent the loss of items when the player starts to reload then fills their inventory slot.
โ Non Goals
It is not a goal to clean up any code in this PR.
๐ฆ Testing
Tested within and outside of dev-env. Seems to work.
โฎ๏ธ Backwards Compatibility
Perfectly backwards compatible.
๐ Related Issues & Documents
๐ Added to documentation?
Summary by CodeRabbit
MagazineReloadAspect.java
file.