mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Laserpointer - Block laser attachments if setting disabled (CBA 3.16.0) (#9346)
* Laserpointer - Block laser attachements if setting disabled req https://github.com/CBATeam/CBA_A3/pull/1595 * Apply suggestions from code review * Update addons/main/script_mod.hpp --------- Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
parent
017e097ac4
commit
c163d6d53a
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user