-
Notifications
You must be signed in to change notification settings - Fork 148
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
Improve removeXCargo functions to retain readded items properly #596
Merged
commy2
merged 14 commits into
CBATeam:master
from
jonpas:removeMagazineCargoRetainAmmoCount
Mar 20, 2017
Merged
Improve removeXCargo functions to retain readded items properly #596
commy2
merged 14 commits into
CBATeam:master
from
jonpas:removeMagazineCargoRetainAmmoCount
Mar 20, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jonpas
changed the title
Improve removeXCargo functions to retain as much items as possible
Improve removeXCargo functions to retain readded items properly
Feb 19, 2017
"arifle_MX_ACO_pointer_F" call CBA_fnc_getNonPresetClass
"arifle_MX_F"
//0.362713 ms "arifle_MX_ACO_pointer_F" call CBA_fnc_weaponComponents
["arifle_mx_f","optic_aco","acc_pointer_ir"]
//0.317662 ms
|
commy2
reviewed
Feb 19, 2017
|
||
// Check parent | ||
private _parent = inheritsFrom _config; | ||
if (_parent isEqualTo configNull) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isNull
…ull, Fix possible script error
…, Fix test result check
"arifle_MX_ACO_pointer_F" call CBA_fnc_getNonPresetClass
-> "arifle_mx_f"
//0.0830 ms - first run (full caching - currently used)
//0.0215 ms - subsequent runs (full caching - currently used)
//0.0765 ms - first run (container-only caching)
//0.0315 ms - subsequent runs (container-only caching) "arifle_MX_ACO_pointer_F" call CBA_fnc_weaponComponents
-> ["arifle_mx_f","optic_aco","acc_pointer_ir"]
//0.0560 ms - first run
//0.0160 ms - subsequent runs ["B_AssaultPack_mcamo_Ammo", "CfgVehicles"] call CBA_fnc_getNonPresetClass
-> "B_Carryall_mcamo"
//0.0425 ms - first run
//0.0170 ms - subsequent runs |
|
|
Very nice! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When merged this pull request will:
CBA_fnc_getNoLinkedItemsClass
- gets the first ancestor (or just passed class) that has no preset attachments (LinkedItems
) or contents (TransportX
)CBA_fnc_getNoLinkedItemsClass
CBA_fnc_removeBackpackCargo
- now retains all contents of other backpacks in containerCBA_fnc_removeMagazineCargo
- now retains ammo count of other magazines in containerCBA_fnc_removeWeaponCargo
- now retains all attachments and loaded magazines of other weapons in containerremoveXCargo
functionsremoveXCargo
functions to 4 spacesremoveXCargo
functionsCBA_fnc_weaponComponents
caching (was caching the result instead of passed class)The only issue remaining is with
CBA_fnc_removeBackpackCargo
andCBA_fnc_removeWeaponCargo.sqf
, it is not possible to readd attachments and loaded magazines directly onto a weapon inside a container, or a weapon with already set attachments and loaded magazines. The current workaround used here adds those attachments and loaded magazines next to the weapon.