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

Laserpointer - Block laser attachments if setting disabled (CBA 3.16.0) #9346

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion addons/laserpointer/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ GVAR(greenLaserUnits) = [];
["CBA_settingsInitialized", {
// If not enabled, dont't add draw eventhandler or PFEH (for performance)
if (!GVAR(enabled)) exitWith {
["ACE_acc_pointer_red", { false }] call CBA_fnc_addAttachmentCondition;
["ACE_acc_pointer_green", { false }] call CBA_fnc_addAttachmentCondition;
["CBA_attachmentSwitched", {
params ["_unit", "_prevItem", "_newItem", "_currWeaponType"];
TRACE_4("CBA_attachmentSwitched eh",_unit,_prevItem,_newItem,_currWeaponType);
if ((getNumber (configFile >> "CfgWeapons" >> _newItem >> "ACE_laserpointer")) > 0) then {
TRACE_1("removing ACE_laserpointer",getNumber (configFile >> "CfgWeapons" >> _newItem >> "ACE_laserpointer"));
[1, "prev"] call CBA_accessory_fnc_switchAttachment;
[1, "next"] call CBA_accessory_fnc_switchAttachment;
};
}] call CBA_fnc_addEventHandler;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 2.12
#define REQUIRED_CBA_VERSION {3,15,7}
#define REQUIRED_CBA_VERSION {3,16,0}
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved

#ifdef COMPONENT_BEAUTIFIED
#define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED)
Expand Down