Skip to content

fix CBA_fnc_compatibleMagazines skipping muzzle magazines#1122

Merged
commy2 merged 1 commit intomasterfrom
fix-compatibleMagazines-muzzles
Apr 22, 2019
Merged

fix CBA_fnc_compatibleMagazines skipping muzzle magazines#1122
commy2 merged 1 commit intomasterfrom
fix-compatibleMagazines-muzzles

Conversation

@commy2
Copy link
Copy Markdown
Contributor

@commy2 commy2 commented Apr 22, 2019

When merged this pull request will:

  • CBA_fnc_compatibleMagazines ignores sub muzzle magazines and magwells
  • Therefore arifle_mx_F and arifle_mx_GL_F are claimed to use the same mags even though GL is compatible with all the under barrel grenade launcher rounds

Before:

"arifle_MX_GL_F" call CBA_fnc_compatibleMagazines
//["30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_green","30Rnd_65x39_caseless_green_mag_Tracer"]

"Throw" call CBA_fnc_compatibleMagazines
[]

After:

"arifle_MX_GL_F" call CBA_fnc_compatibleMagazines
//["30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_green","30Rnd_65x39_caseless_green_mag_Tracer","1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell"]

"Throw" call CBA_fnc_compatibleMagazines
//["HandGrenade_Stone","HandGrenade","MiniGrenade","SmokeShell","SmokeShellYellow","SmokeShellGreen","SmokeShellRed","SmokeShellPurple","SmokeShellOrange","SmokeShellBlue","Chemlight_green","Chemlight_red","Chemlight_yellow","Chemlight_blue","B_IR_Grenade","O_IR_Grenade","I_IR_Grenade"]

@commy2 commy2 added the Bug Fix label Apr 22, 2019
@commy2 commy2 added this to the 3.11 milestone Apr 22, 2019
@commy2 commy2 merged commit da4da78 into master Apr 22, 2019
@commy2 commy2 deleted the fix-compatibleMagazines-muzzles branch April 22, 2019 09:34
@PabstMirror
Copy link
Copy Markdown
Contributor

It was designed to work for specific muzzles (that's why it takes a config)
This changes break code I've written,

_weapon = "CUP_launch_Mk153Mod0";
{
    if (_x == "this") then { // main gun magazines
        [LAW_PRIMARY_MUZZLE_MAG_INDEX, [configFile >> "CfgWeapons" >> _weapon] call CBA_fnc_compatibleMagazines]
    } else { // underslung weapon magazines
        [LAW_SECONDARY_MUZZLE_MAG_INDEX, [configFile >> "CfgWeapons" >> _weapon >> _x] call CBA_fnc_compatibleMagazines]
    } params ["_arrayIndex", "_magazines"];
    
    // set mag in arrayIndex...
} forEach getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");

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.

3 participants