Partial rewrite of the looting code, for both recovery truck and recruit looting. Changes a lot of small details but keeps looting working the same on larger scale.
I created two generic inventory management functions: OT_fnc_dumpContainer adds all items from one container to another and OT_fnc_dumpUnitLoadout adds items from unit's loadout to a container. These are based on the latest Arma inventory commands and can correctly copy all items that a container or unit might have, handling all edge cases like half used magazines, weapon attached magazines, items inside backpacks and vests, laser designator batteries, ACE medical item replacements etc. The new looting code uses these functions to handle all inventory management correctly. These will probably replace other inventory management functions in the future, like OT_fnc_dumpStuff and OT_fnc_transferHelper. Ultimately I think the correct place for these generic functions would be CBA so I might make a pull request there at some point (related: https://github.com/CBATeam/CBA_A3/issues/1551).
Outside of inventory management, the looting code now also loots all item piles on the ground. Looting with recruits handles cases like multiple looters looting at the same time. Looters will collect weapons when they visit a body instead of all weapons just teleporting in at the beginning.
See commit messages and code comments for more info.
Partial rewrite of the looting code, for both recovery truck and recruit looting. Changes a lot of small details but keeps looting working the same on larger scale.
I created two generic inventory management functions:
OT_fnc_dumpContainer
adds all items from one container to another andOT_fnc_dumpUnitLoadout
adds items from unit's loadout to a container. These are based on the latest Arma inventory commands and can correctly copy all items that a container or unit might have, handling all edge cases like half used magazines, weapon attached magazines, items inside backpacks and vests, laser designator batteries, ACE medical item replacements etc. The new looting code uses these functions to handle all inventory management correctly. These will probably replace other inventory management functions in the future, likeOT_fnc_dumpStuff
andOT_fnc_transferHelper
. Ultimately I think the correct place for these generic functions would be CBA so I might make a pull request there at some point (related: https://github.com/CBATeam/CBA_A3/issues/1551).Outside of inventory management, the looting code now also loots all item piles on the ground. Looting with recruits handles cases like multiple looters looting at the same time. Looters will collect weapons when they visit a body instead of all weapons just teleporting in at the beginning.
See commit messages and code comments for more info.