ACE3/addons/concertina_wire/functions/fnc_dismount.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

38 lines
930 B
Plaintext

/*
* Author: Ruthberg
*
* Start dismounting the concertina wire
*
* Arguments:
* 0: wire <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitWith {
[{
_this call FUNC(dismount);
}, _this] call CBA_fnc_execNextFrame;
};
params ["_wire", "_unit"];
private _config = (configFile >> "CfgVehicles" >> typeOf _unit);
private _delay = [120, 60] select (getNumber (_config >> "engineer") == 1 || {getNumber (_config >> "canDeactivateMines") == 1});
// TODO: Animation?
[
_delay,
[_wire],
{(_this select 0) call FUNC(dismountSuccess)},
{},
localize "STR_ACE_UNROLLWIRE",
{true},
["isnotinside"]
] call EFUNC(common,progressBar);