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

magazines not attached to weapons in use are omitted from CBA_fnc_uniqueUnitItems #1156

Closed
zharf opened this issue Jun 5, 2019 · 2 comments · Fixed by #1157
Closed

magazines not attached to weapons in use are omitted from CBA_fnc_uniqueUnitItems #1156

zharf opened this issue Jun 5, 2019 · 2 comments · Fixed by #1157
Assignees
Labels
Milestone

Comments

@zharf
Copy link

zharf commented Jun 5, 2019

Arma 3 Version: 1.92 (stable)
CBA Version: 3.11.2 (stable)

Mods:

- CBA_A3

Description:

  • CBA_fnc_uniqueUnitItems does not return any magazines not currently attached to a weapon in use by the unit. It seems that getItemCargo doesn't return them while magazines does.

Steps to reproduce:

  • Place down ammo carrier, drop weapons and observe result of CBA_fnc_uniqueUnitItems

Where did the issue occur?

  • Dedicated / Editor (Singleplayer) / Editor (Multiplayer)

RPT log file:

@commy2
Copy link
Contributor

commy2 commented Jun 7, 2019

I pinged dedmen, because from looking at the code, it seems that uniqueUnitItems is not supposed to return any magazine, and the command returning loaded magazines at all (if _weaponItems flag is set to true) is just a byproduct of optimization: this function also reports the empty string as item (no attachment at atleast one hardpoint), even though it is not an item, because the function is used for writing optimized code. (Substitude for a missing command like _unit hasItem "class").

@commy2 commy2 added the Feature label Jun 7, 2019
@commy2 commy2 added this to the 3.12 milestone Jun 7, 2019
@commy2 commy2 self-assigned this Jun 7, 2019
@dedmen
Copy link
Contributor

dedmen commented Jun 11, 2019

it seems that uniqueUnitItems is not supposed to return any magazine

True, it was not written for that. It was written as a fast way to check if the player has "items" in their inventory, magazines are not items.
But I see that from a API standpoint it makes much more sense to include that.

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 a pull request may close this issue.

3 participants