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

implement addWeaponWithAttachmentsCargoGlobal command #1188

Merged
merged 3 commits into from
Jul 26, 2019
Merged

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Jul 26, 2019

When merged this pull request will:

  • title

This means mags and attachments are now on the dropped weapon, and rare classes with preconfigured attachments don't create those attachments out of thin air anymore when they were removed before the weapon was dropped.

@commy2 commy2 added Enhancement 1.94 Contact DLC labels Jul 26, 2019
@commy2 commy2 added this to the 3.12.1 milestone Jul 26, 2019
@jonpas
Copy link
Member

jonpas commented Jul 26, 2019

Also needs to be done for removeXCargo commands.

@commy2
Copy link
Contributor Author

commy2 commented Jul 26, 2019

You mean your functions?

@jonpas
Copy link
Member

jonpas commented Jul 26, 2019

Yeah, just reminder.

@commy2

This comment has been minimized.

@commy2
Copy link
Contributor Author

commy2 commented Jul 26, 2019

19:42:24 [CBA] (common) Test OK: (CBA_fnc_addWeapon is defined) x\cba\addons\common\test_inventory.sqf:13
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:16
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:19
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:22
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:30
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:33
19:42:24 a3\weapons_f\acc\reticle_nlaw.p3d: No geometry and no visual shape
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:36
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:39
19:42:24 [CBA] (common) Test OK: (CBA_fnc_addMagazine is defined) x\cba\addons\common\test_inventory.sqf:46
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:49
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:52
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:55
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:63
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:66
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:69
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:74
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:89
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:93
19:42:24 [CBA] (common) Test OK: (count (backpackCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:94
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:99
19:42:24 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (itemCargo _container) == 4 && count (magazineCargo _container) == 20) x\cba\addons\common\test_inventory.sqf:100
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:108
19:42:24 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (weaponCargo _container) == 0 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:109
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:117
19:42:24 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (weaponCargo _container) == 1 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:118
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:126
19:42:24 [CBA] (common) Test OK: (count (backpackCargo _container) == 0 && count (weaponCargo _container) == 1) x\cba\addons\common\test_inventory.sqf:127
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:136
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:140
19:42:24 [CBA] (common) Test OK: (count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:141
19:42:24 [CBA] (common) Test OK: (count (itemCargo _container) == 4) x\cba\addons\common\test_inventory.sqf:146
19:42:24 [CBA] (common) Test OK: (count (itemCargo _container) == 1 && count (itemCargo (((everyContainer _container) select 0) select 1)) == 5) x\cba\addons\common\test_inventory.sqf:153
19:42:24 [CBA] (common) Test OK: (count (itemCargo _container) == 5) x\cba\addons\common\test_inventory.sqf:159
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:167
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:171
19:42:24 [CBA] (common) Test OK: (count (magazineCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:172
19:42:24 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:180
19:42:24 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:184
19:42:24 [CBA] (common) Test OK: (count (weaponCargo _container) == 2 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:185
19:42:24 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:191
19:42:24 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:197
19:42:24 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 1) x\cba\addons\common\test_inventory.sqf:203
19:42:24 [CBA] (common) Test OK: (count (weaponCargo _container) == 1 && count (itemCargo _container) == 0) x\cba\addons\common\test_inventory.sqf:210

Test passes now after I fixed things.

@@ -115,7 +115,7 @@ _container addBackpackCargoGlobal ["B_AssaultPack_mcamo", 1];
((everyBackpack _container) select 0) addWeaponCargoGlobal ["arifle_MX_ACO_pointer_F", 1];
_result = [_container, "B_AssaultPack_mcamo", 1, true] call CBA_fnc_removeBackpackCargo;
TEST_TRUE(_result,_funcName);
TEST_TRUE(count (backpackCargo _container) == 0 && count (weaponCargo _container) == 1 && count (itemCargo _container) == 2,_funcName);
TEST_TRUE(count (backpackCargo _container) == 0 && count (weaponCargo _container) == 1 && count (itemCargo _container) == 0,_funcName);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is different from the previous one in that it keeps the attachments. But since AWWACG adds the attachments to the weapon instead of the cargo, both tests have count itemCargo == 0.

@commy2
Copy link
Contributor Author

commy2 commented Jul 26, 2019

Done.

Copy link
Member

@jonpas jonpas left a comment

Choose a reason for hiding this comment

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

Thanks!

@commy2 commy2 merged commit 3227dbb into master Jul 26, 2019
@commy2 commy2 deleted the use-AWWACG branch July 26, 2019 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants