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 support for removing non-preset weapon if preset weapon present to removeWeaponCargo #706

Merged
merged 2 commits into from
Jun 24, 2017
Merged

Add support for removing non-preset weapon if preset weapon present to removeWeaponCargo #706

merged 2 commits into from
Jun 24, 2017

Conversation

jonpas
Copy link
Member

@jonpas jonpas commented Jun 21, 2017

When merged this pull request will:

  • When passing a non-preset classname to removeWeaponCargo function and there is a preset weapon (classname that has predefined attachments/magazine), it will now remove the weapon only and leave the attachments/magazine itself. To remove the whole preset weapon, the preset class has to be used.
  • Change behaviour a bit, but this is expected behaviour I think.
  • Support multiple weapon removal as well (except when called in succession instead of using the number argument, due to inability to readd attachments to weapon when in cargo).
  • Add test for new functionality.

@jonpas
Copy link
Member Author

jonpas commented Jun 21, 2017

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

19:17:37 [CBA] (common) Test OK: (CBA_fnc_addWeapon is defined) x\cba\addons\common\test_inventory.sqf:13
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:16
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:19
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:22
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:30
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:33
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:36
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:39
19:17:37 [CBA] (common) Test OK: (CBA_fnc_addMagazine is defined) x\cba\addons\common\test_inventory.sqf:46
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:49
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:52
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:55
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:63
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:66
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:69
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:74
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:89
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:93
19:17:37 [CBA] (common) Test OK: (count (backpackCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:94
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:102
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:106
19:17:37 [CBA] (common) Test OK: (count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:107
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:115
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:119
19:17:37 [CBA] (common) Test OK: (count (magazineCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:120
19:17:37 [CBA] (common) Test OK: (not (_result)) x\cba\addons\common\test_inventory.sqf:128
19:17:37 [CBA] (common) Test OK: (_result) x\cba\addons\common\test_inventory.sqf:132
19:17:37 [CBA] (common) Test OK: (count (weaponCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:133
19:17:37 [CBA] (common) Test OK: (count (weaponCargo _container) == 0 && count (itemCargo _container) == 2) x\cba\addons\common\test_inventory.sqf:138

Last line is the new test.

@jonpas
Copy link
Member Author

jonpas commented Jun 21, 2017

If this is wanted behaviour indeed, I'll do the same for removeBackpackCargo and removeItemCargo (for other containers) after #707 is merged. Let me know if additional argument would be better for either of those though.

@Killswitch00 Killswitch00 added this to the 3.4 milestone Jun 24, 2017
@Killswitch00 Killswitch00 merged commit 38d8629 into CBATeam:master Jun 24, 2017
@jonpas jonpas deleted the removeWeaponCargoNonPresetWhenPreset branch June 24, 2017 17:21
@jonpas
Copy link
Member Author

jonpas commented Jun 24, 2017

So, this is wanted and preferred over old behaviour I assume?

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.

None yet

2 participants