ACE3/addons/explosives/functions/fnc_selectTrigger.sqf
Glowbal b489750d5b Minor optimizations using private, params, and isEqualType (#4323)
* Optimizations with private, params, and isEqualType

* Fixed tab being used instead of space

* Fixed tabs inserted by notepad++

* More usage of new private syntax and params

- changed a few checks for an array being empty to `_arr isEqualTo []`
rather than `count _arr == 0`
- added more uses of `private` on the same line as the variable is
declared
- added more uses of params to assign variables passed as parameters
- removed unnecessary parentheses
- removed several unnecessary variable declarations with private array
syntax

* clean up and formatting
2016-09-04 16:44:22 +02:00

31 lines
901 B
Plaintext

/*
* Author: Garth 'L-H' de Wet
* Selects a trigger for an explosive.
*
* Arguments:
* 0: Explosive <OBJECT>
* 1: Magazine <STRING>
* 2: Trigger mode <STRING>
*
* Return Value:
* None
*
* Example:
* [_explosive, "SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
*
* Public: No
*/
#include "script_component.hpp"
params ["_explosive", "_magazine", "_trigger"];
TRACE_3("params",_explosive,_magazine,_trigger);
private _config = ConfigFile >> "ACE_Triggers" >> _trigger;
// If the onSetup function returns true, it is handled elsewhere
if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith {
TRACE_2("onSetup returned true",_explosive,_trigger);
};
[ACE_player, getPosATL _explosive, _explosive getVariable [QGVAR(Direction), 0],_magazine, _trigger, [], _explosive] call FUNC(placeExplosive);