Fix AIM needs to be closed multiple times when moving all inventory/worn items to ground #47602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Bugfixes "Fix AIM needs to be closed multiple times when moving all inventory/worn items to ground"
Purpose of change
When moving all inventory/worn items to ground, AIM needs to be closed multiple times to be actually closed.
Describe the solution
Only call
do_return_entry
once when AIM is about to be automatically closed due to pending activity, and do not calldo_return_entry
if there's no pending activity.In addition, some adjustments are made to relevant code to clarify code and fix several bugs:
advanced_inventory::move_all_items
,entry
is now directly assigned with the next value instead of incremented at the beginning. This fixes a bug where only the items in the first (south-west) vehicle square is moved when moving all surrounding items.on_out_of_scope
is used to restore the all items location after selecting a specific location for moving, in case the code returns early.2.1. The copy/move constructor/assignment operators of
on_out_of_scope
andrestore_on_out_of_scope
are marked as deleted, because copying and moving are not well-defined for these classes.no enough room
query is shown before moving inventory/worn items to the ground/a vehicle, if there is not enough room at the destination square, to be consistent with moving items between ground/vehicle squares.Testing
"CLOSE_ADV_INV"
setting and AIM was closed after moving all surrounding items when the setting was on, and not closed when the setting was off.Additional context
This can be merged for 0.F while #45243 is under feature freeze.