-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accessory - Add conditional blocking of switchable attachments (#1595)
Co-authored-by: Jouni Järvinen <[email protected]> Co-authored-by: jonpas <[email protected]>
- Loading branch information
1 parent
c760f60
commit 33f6c0d
Showing
5 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "script_component.hpp" | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_addAttachmentCondition | ||
Description: | ||
Adds condition to be able to switch to an attachment. | ||
Parameters: | ||
0: _item - Attachment classname <STRING> | ||
1: _condition - Code (return false if not allowed) <CODE> | ||
Returns: | ||
None | ||
Examples: | ||
(begin example) | ||
["ACE_acc_pointer_red", { false }] call CBA_fnc_addAttachmentCondition | ||
(end) | ||
Author: | ||
PabstMirror | ||
---------------------------------------------------------------------------- */ | ||
|
||
params [["_item", "", [""]], ["_condition", {true}, [{}]]]; | ||
|
||
if (!isClass (configfile >> "CfgWeapons" >> _item)) exitWith { ERROR_1("Item not found [%1]", _item); }; | ||
|
||
private _usageArray = GVAR(usageHash) getOrDefault [_item, [], true]; | ||
_usageArray pushBack _condition; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters