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

Add keep contents/attachments support and fix non-existing non-preset weapon parents in removeXCargo functions #726

Merged
merged 5 commits into from
Jul 21, 2017

Conversation

jonpas
Copy link
Member

@jonpas jonpas commented Jul 18, 2017

When merged this pull request will:

  • Fix CBA_fnc_removeWeaponCargo deletes MX LSW #725 in removeWeaponCargo, removeItemCargo and removeBackpackCargo functions - limitation being that removed attachments that are in preset will reappear (engine limitation)
  • Add "keep attachments/contents" functionality (new argument) to removeWeaponCargo, removeItemCargo and removeBackpackCargo functions, default false (as it was before this)
  • Add further unit tests for non-existing non-preset weapon parent issue and new "keep attachments/contents" functionality

@jonpas
Copy link
Member Author

jonpas commented Jul 18, 2017

execVM "\x\cba\addons\common\test_inventory.sqf";

16:35:56 [CBA] (common) Test OK: (CBA_fnc_addWeapon is defined) x\cba\addons\common\test_inventory.sqf:13
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:16
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:19
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:22
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:30
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:33
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:36
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:39
16:35:56 [CBA] (common) Test OK: (CBA_fnc_addMagazine is defined) x\cba\addons\common\test_inventory.sqf:46
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:49
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:52
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:55
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:63
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:66
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:69
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:74
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:89
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:93
16:35:56 [CBA] (common) Test OK: (count (backpackCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:94
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:99
16:35:56 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (itemCargo _container) == 4 && count (magazineCargo _container) == 20) x\cba\addons\common\test_inventory.sqf:100
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:108
16:35:56 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (weaponCargo _container) == 0 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:109
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:117
16:35:56 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (weaponCargo _container) == 1 && count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:118
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:126
16:35:56 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (weaponCargo _container) == 1) x\cba\addons\common\test_inventory.sqf:127
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:136
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:140
16:35:56 [CBA] (common) Test OK: (count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:141
16:35:56 [CBA] (common) Test OK: (count (itemCargo _container) == 1 && count (itemCargo (((everyContainer _container) select 0) select 1)) == 5) x\cba\addons\common\test_inventory.sqf:148
16:35:56 [CBA] (common) Test OK: (count (itemCargo _container) == 5) x\cba\addons\common\test_inventory.sqf:154
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:162
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:166
16:35:56 [CBA] (common) Test OK: (count (magazineCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:167
16:35:56 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:175
16:35:56 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:179
16:35:56 [CBA] (common) Test OK: (count (weaponCargo _container) == 2 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:180
16:35:56 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:186
16:35:56 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:192
16:35:56 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 1) x\cba\addons\common\test_inventory.sqf:198
16:35:56 [CBA] (common) Test OK: (count (weaponCargo _container) == 1 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:205

@@ -21,6 +23,9 @@ Examples:

// Remove 2 Carryall Desert Camo backpacks from a box
_success = [myCoolBackpackBox, "B_Carryall_ocamo", 2] call CBA_fnc_removeBackpackCargo;

// Remove 1 Backpack from a box and keep conents
Copy link
Contributor

Choose a reason for hiding this comment

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

"contents"

@Killswitch00 Killswitch00 added this to the 3.4.1 milestone Jul 19, 2017
@Killswitch00 Killswitch00 merged commit d6ccb02 into CBATeam:master Jul 21, 2017
@jonpas jonpas deleted the fixRemoveWeaponCargo branch July 21, 2017 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants