Page MenuHomeFeedback Tracker

Arsenal does not recognize all compatible attachments
Closed, ResolvedPublic

Description

Compatible attachments defined in mods using compatibleItems class are not shown in the Arsenal.

Details

Legacy ID
3105282474
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Virtual Arsenal
Steps To Reproduce

Install mods using the compatibleItems {} class structure to define compatible accessories for weapons and test them in Arsenal.

Additional Information

Bug in the bis_fnc_compatibleItems function:

The isclass _x condition in the inner loop seems to be the cause, working if removed:

original:

			if (isclass _cfgCompatibleItems) then {
				{
					if (getnumber _x > 0) then {_compatibleItems pushback configname _x;};
				} foreach configproperties [_cfgCompatibleItems,"isclass _x"];
			};

Fixed:

			if (isclass _cfgCompatibleItems) then {
				{
					if (getnumber _x > 0) then {_compatibleItems pushback configname _x;};
				} foreach configproperties [_cfgCompatibleItems,"isnumber _x"];
			};

Event Timeline

Robalo edited Steps To Reproduce. (Show Details)Mar 12 2015, 10:59 PM
Robalo edited Additional Information. (Show Details)
Robalo set Category to Virtual Arsenal.
Robalo set Reproducibility to Always.
Robalo set Severity to None.
Robalo set Resolution to Fixed.
Robalo set Legacy ID to 3105282474.May 8 2016, 11:39 AM

Simple fix, on a plate, please apply this BIS so we don't have to download this amendment after every update.

Thanks Robalo.

Also causes the Garage/Vehicle arsenal to crash.

Fixed in dev branch two weeks ago, could you please verify?

New function BIS_fnc_compatibleItems was written for it.

Robalo added a subscriber: Robalo.May 8 2016, 11:39 AM

Not resolved. There's a bug in the BIS_fnc_compatibleItems, see the aditional information section.
You are looping config properties of a compatileItems class and filtering them with isclass. Since it's not classes you're looking for, that inner loop will find nothing.

Yea, the current function in the Arsenal on devBranch doesn't seem to be picking up the parameters from class compatibleItems. I.e. compatability defined in the format:

    class compatibleItems {
        MY_Optic1 = 1;
        MY_Optic2 = 1;
    };

The list remains empty for weapons that only have a slot with compatibility defined in this manner.

Updated the additional information section: the "isclass _x" filter should be "isnumber _x" instead.
Another thing, if this gets fixed, there is potential for the function to return duplicates and clutter the arsenal.

Condition fixed, should appear in the next dev branch update.

BTW: Had to hack your ASDG Joint Rails addon and remove function hotfix from there, so I could actually test my fix :)

Thanks a bunch Moricky, looks like today's dev has the fix.
Thoughts on making sure it does not return any duplicates ? New ticket ? =D

Just noticed this condition was removed: if (getnumber _x > 0)
This means even attachments marked as incompatible (something = 0) will be returned.