From 8dfdd11f3c27893e90a6e894914d11dba8afcc54 Mon Sep 17 00:00:00 2001 From: Thomas Kooi Date: Sun, 18 Jan 2015 20:09:19 +0100 Subject: [PATCH] Changed tabs to 4 spaces --- addons/common/functions/fnc_carryObj.sqf | 86 +++++------ .../functions/fnc_cleanUpCopyOfBody_f.sqf | 2 +- .../functions/fnc_closeAllDialogs_f.sqf | 2 +- addons/common/functions/fnc_debug.sqf | 38 ++--- .../common/functions/fnc_defineVariable.sqf | 12 +- addons/common/functions/fnc_disableAI_f.sqf | 14 +- addons/common/functions/fnc_dropWeapon_f.sqf | 14 +- .../fnc_getAllDefinedSetVariables.sqf | 16 +- .../functions/fnc_getCustomResults_f.sqf | 38 ++--- addons/common/functions/fnc_getDeathAnim.sqf | 40 ++--- .../functions/fnc_getDefinedVariable.sqf | 24 +-- .../fnc_getDefinedVariableDefault.sqf | 2 +- .../fnc_getFirstObjectIntersection.sqf | 30 ++-- .../fnc_getFirstTerrainIntersection.sqf | 30 ++-- .../functions/fnc_getNumberMagazinesIn.sqf | 10 +- .../functions/fnc_getUnconsciousCondition.sqf | 14 +- addons/common/functions/fnc_hasMagazine.sqf | 4 +- addons/common/functions/fnc_inWater_f.sqf | 8 +- addons/common/functions/fnc_inheritsFrom.sqf | 4 +- addons/common/functions/fnc_insertionSort.sqf | 18 +-- addons/common/functions/fnc_isHC.sqf | 12 +- .../functions/fnc_limitMovementSpeed.sqf | 48 +++--- .../functions/fnc_loadPersonLocal_f.sqf | 22 +-- addons/common/functions/fnc_loadPerson_f.sqf | 28 ++-- .../common/functions/fnc_makeCopyOfBody_f.sqf | 92 +++++------ .../functions/fnc_moduleBasicRevive.sqf | 2 +- .../common/functions/fnc_moveToTempGroup.sqf | 26 ++-- .../common/functions/fnc_onAnswerRequest.sqf | 24 +-- .../functions/fnc_raiseScriptedEvent_f.sqf | 66 ++++---- .../common/functions/fnc_receiveRequest.sqf | 48 +++--- .../fnc_registerUnconsciousCondition.sqf | 12 +- .../functions/fnc_resetAllDefaults_f.sqf | 24 +-- .../common/functions/fnc_revealObject_f.sqf | 12 +- addons/common/functions/fnc_sendRequest_f.sqf | 8 +- .../common/functions/fnc_setArrestState.sqf | 44 +++--- .../common/functions/fnc_setCanInteract.sqf | 18 +-- .../common/functions/fnc_setCaptiveSwitch.sqf | 20 +-- addons/common/functions/fnc_setCarriedBy.sqf | 6 +- addons/common/functions/fnc_setDead.sqf | 84 +++++----- .../functions/fnc_setDefinedVariable.sqf | 12 +- .../fnc_setDisableUserInputStatus.sqf | 14 +- .../functions/fnc_setHearingCapability.sqf | 24 +-- addons/common/functions/fnc_setProne.sqf | 24 +-- .../functions/fnc_setUnconsciousState.sqf | 146 +++++++++--------- addons/common/functions/fnc_setVolume_f.sqf | 38 ++--- .../fnc_setWeaponsCorrectUnconscious.sqf | 26 ++-- .../functions/fnc_sortAlphabeticallyBy.sqf | 28 ++-- addons/common/functions/fnc_stringCompare.sqf | 4 +- .../functions/fnc_switchToGroupSide_f.sqf | 76 ++++----- .../functions/fnc_uniqueElementsOnly.sqf | 8 +- .../common/functions/fnc_unloadPerson_f.sqf | 40 ++--- addons/common/functions/fnc_useItem.sqf | 24 +-- addons/common/functions/fnc_useMagazine.sqf | 16 +- 53 files changed, 747 insertions(+), 735 deletions(-) diff --git a/addons/common/functions/fnc_carryObj.sqf b/addons/common/functions/fnc_carryObj.sqf index bf78603033..a5cea92a9b 100644 --- a/addons/common/functions/fnc_carryObj.sqf +++ b/addons/common/functions/fnc_carryObj.sqf @@ -15,60 +15,60 @@ _unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param; _to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param; _fallDown = false; if (count _this > 3) then { - _fallDown = _this select 3; + _fallDown = _this select 3; }; _return = false; [format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call FUNC(debug); if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) || isNull _to) then { - if (vehicle _unit != _unit) exitwith {}; - if (!isNull _to) then { - if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then { - _return = true; - _unit setvariable [QGVAR(carriedObj),_to,true]; - if (_fallDown) then { - // [_unit,_fallDown] call FUNC(limitMovementSpeed); - }; - [_to, _unit] call FUNC(setCarriedBy); - if (count _this > 2) then { - if (count (_this select 2) == 3) then { - _to attachTo [_unit,(_this select 2)]; - [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug); - }; - } else { - [format["fnc_carryObj - UNIT: %1 TO %2 - Script expects external handling of attachTo Command. Exiting",_unit,_to],2] call FUNC(debug); - }; + if (vehicle _unit != _unit) exitwith {}; + if (!isNull _to) then { + if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then { + _return = true; + _unit setvariable [QGVAR(carriedObj),_to,true]; + if (_fallDown) then { + // [_unit,_fallDown] call FUNC(limitMovementSpeed); + }; + [_to, _unit] call FUNC(setCarriedBy); + if (count _this > 2) then { + if (count (_this select 2) == 3) then { + _to attachTo [_unit,(_this select 2)]; + [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug); + }; + } else { + [format["fnc_carryObj - UNIT: %1 TO %2 - Script expects external handling of attachTo Command. Exiting",_unit,_to],2] call FUNC(debug); + }; - [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); + [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); - }; - } else { - if (!isNull ([_unit] call FUNC(getCarriedObj))) then { - [format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug); - _carriedObj = ([_unit] call FUNC(getCarriedObj)); + }; + } else { + if (!isNull ([_unit] call FUNC(getCarriedObj))) then { + [format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug); + _carriedObj = ([_unit] call FUNC(getCarriedObj)); - detach _carriedObj; - //_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0]; - if (!surfaceIsWater getPos _unit) then { - _positionUnit = getPosATL _carriedObj; - _positionUnit set [2, ((getPosATL _unit) select 2) + 0.1]; - _carriedObj setPosATL _positionUnit; - } else { - _positionUnit = getPosASL _carriedObj; - _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; - _carriedObj setPosASL _positionUnit; - }; - [[_unit, _carriedObj],"carryObjectDropped"] call FUNC(raiseScriptedEvent_f); + detach _carriedObj; + //_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0]; + if (!surfaceIsWater getPos _unit) then { + _positionUnit = getPosATL _carriedObj; + _positionUnit set [2, ((getPosATL _unit) select 2) + 0.1]; + _carriedObj setPosATL _positionUnit; + } else { + _positionUnit = getPosASL _carriedObj; + _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; + _carriedObj setPosASL _positionUnit; + }; + [[_unit, _carriedObj],"carryObjectDropped"] call FUNC(raiseScriptedEvent_f); - [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy); - _unit setvariable [QGVAR(carriedObj),_to,true]; - _return = true; + [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy); + _unit setvariable [QGVAR(carriedObj),_to,true]; + _return = true; - [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); - }; - }; + [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); + }; + }; } else { - [format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug); + [format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug); }; _return diff --git a/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf b/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf index 7bc3c11199..8831b438b0 100644 --- a/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf +++ b/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf @@ -20,7 +20,7 @@ if (isnil "_copy") exitwith {false}; _unit setvariable [QGVAR(originalCopy_f), nil, true]; _unit setvariable [QGVAR(copyOfBody_f), nil, true]; if (!isNull _copy) then { - deleteVehicle _copy; + deleteVehicle _copy; }; true; \ No newline at end of file diff --git a/addons/common/functions/fnc_closeAllDialogs_f.sqf b/addons/common/functions/fnc_closeAllDialogs_f.sqf index 843f45bc62..b5ce1bc280 100644 --- a/addons/common/functions/fnc_closeAllDialogs_f.sqf +++ b/addons/common/functions/fnc_closeAllDialogs_f.sqf @@ -10,5 +10,5 @@ #include "script_component.hpp" while {dialog} do { - closeDialog 0; + closeDialog 0; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 4caf710a83..65edb41094 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -17,37 +17,37 @@ _msg = _this select 0; _level = if (count _this > 1) then {_this select 1} else { 2 }; _defaultLoglevel = if (isNil QGVAR(LOGLEVEL)) then { - DEFAULT_LOGGING_LEVEL; + DEFAULT_LOGGING_LEVEL; } else { - GVAR(LOGLEVEL); + GVAR(LOGLEVEL); }; _defaultLogDisplayLevel = if (isnil QGVAR(LOGDISPLAY_LEVEL)) then { - DEFAULT_TEXT_DISPLAY; + DEFAULT_TEXT_DISPLAY; } else { - GVAR(LOGDISPLAY_LEVEL); + GVAR(LOGDISPLAY_LEVEL); }; if (_defaultLoglevel < 0) exitwith { - false + false }; if (_level <= _defaultLoglevel) then { - _prefix = switch (_level) do { - case 0: { "ACE Error" }; - case 1: { "ACE Warn" }; - case 2: { "ACE Debug" }; - case 3: { "ACE Info" }; - default { "ACE Unknown" }; - }; - _message = format["[%1] %2",_prefix,_msg]; + _prefix = switch (_level) do { + case 0: { "ACE Error" }; + case 1: { "ACE Warn" }; + case 2: { "ACE Debug" }; + case 3: { "ACE Info" }; + default { "ACE Unknown" }; + }; + _message = format["[%1] %2",_prefix,_msg]; - if (_level >= _defaultLogDisplayLevel) then { - systemChat _message; - }; - diag_log _message; + if (_level >= _defaultLogDisplayLevel) then { + systemChat _message; + }; + diag_log _message; - // pass it onwards to the log function: - // [0, [], compile format["%1",_msg], true] call FUNC(log); + // pass it onwards to the log function: + // [0, [], compile format["%1",_msg], true] call FUNC(log); }; true \ No newline at end of file diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index f889b2c6f0..3085fc56fa 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -19,18 +19,18 @@ _persistent = false; if (count _this < 3) exitwith {}; if (count _this > 4) then { - _code = _this select 4; - if (count _this > 5) then { - _persistent = _this select 5; - }; + _code = _this select 4; + if (count _this > 5) then { + _persistent = _this select 5; + }; }; if (typeName _name != typeName "") exitwith { - [format["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); + [format["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) then { - GVAR(OBJECT_VARIABLES_STORAGE) = []; + GVAR(OBJECT_VARIABLES_STORAGE) = []; }; GVAR(OBJECT_VARIABLES_STORAGE) pushback [_name,_value,_defaultGlobal,_catagory,_code, _persistent]; diff --git a/addons/common/functions/fnc_disableAI_f.sqf b/addons/common/functions/fnc_disableAI_f.sqf index e37ff02484..9e1bf59a6f 100644 --- a/addons/common/functions/fnc_disableAI_f.sqf +++ b/addons/common/functions/fnc_disableAI_f.sqf @@ -13,11 +13,11 @@ _unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; _disable = [_this, 1,false,[false]] call BIS_fnc_Param; if (local _unit && !(IsPlayer _unit)) then { - if (_disable) then { - _unit disableAI "Move"; - _unit disableAI "TARGET"; - } else { - _unit enableAI "Move"; - _unit enableAI "TARGET"; - }; + if (_disable) then { + _unit disableAI "Move"; + _unit disableAI "TARGET"; + } else { + _unit enableAI "Move"; + _unit enableAI "TARGET"; + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_dropWeapon_f.sqf b/addons/common/functions/fnc_dropWeapon_f.sqf index a8fad3dfcd..bf1358b5e7 100644 --- a/addons/common/functions/fnc_dropWeapon_f.sqf +++ b/addons/common/functions/fnc_dropWeapon_f.sqf @@ -26,14 +26,14 @@ _secondairyWeapon = secondaryWeapon _unit; _handGunWeapon = handgunWeapon _unit; switch (_currentWeapon) do { - case _primairyWeapon: { + case _primairyWeapon: { - }; - case _secondairyWeapon: { + }; + case _secondairyWeapon: { - }; - case _handGunWeapon: { + }; + case _handGunWeapon: { - }; - default {}; + }; + default {}; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index eb9e77f2da..529c11c549 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -7,22 +7,24 @@ * @Return: ARRAY REturns an array with the format [ [name STRING, typeName STRING, value ANY, publicFlag BOOL, peristentFlag BOOL] ] * @PublicAPI: true */ + #include "script_component.hpp" + private ["_object", "_return", "_val", "_category"]; _object = _this select 0; _category = if (count _this > 1) then { _this select 1 } else { "" }; if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith { - []; + []; }; _return = []; { - _val = _object getvariable (_x select 0); - if (!isnil "_val") then { - if (_category == "" || _category == _x select 3) then { - _return pushback [_x select 0, typeName _val, _val, _x select 2, _x select 5]; - }; - }; + _val = _object getvariable (_x select 0); + if (!isnil "_val") then { + if (_category == "" || _category == _x select 3) then { + _return pushback [_x select 0, typeName _val, _val, _x select 2, _x select 5]; + }; + }; }foreach GVAR(OBJECT_VARIABLES_STORAGE); _return \ No newline at end of file diff --git a/addons/common/functions/fnc_getCustomResults_f.sqf b/addons/common/functions/fnc_getCustomResults_f.sqf index b7eec1dd06..4b68f85c9c 100644 --- a/addons/common/functions/fnc_getCustomResults_f.sqf +++ b/addons/common/functions/fnc_getCustomResults_f.sqf @@ -17,29 +17,29 @@ _handle = _this select 1; _eventHandlerName = ("ace_f_custom_results_eventhandler_" + _handle); _eventHandlerCollection = missionNamespace getvariable _eventHandlerName; if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - - // TODO Get a replacement for this - _cfg = (ConfigFile >> "Advanced_Combat_Environment" >> "CustomResults" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { - _ehCfg = _cfg select _EHiterator; - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _code = (compile getText(_ehCfg >> "onCall")); - _eventHandlerCollection pushback [_classType, _code]; - true; - }; - }; - }; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; + _eventHandlerCollection = []; + + // TODO Get a replacement for this + _cfg = (ConfigFile >> "Advanced_Combat_Environment" >> "CustomResults" >> _handle); + if (isClass _cfg) then { + _numberOfEH = count _cfg; + for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { + _ehCfg = _cfg select _EHiterator; + if (isClass _ehCfg) then { + _classType = (ConfigName _ehCfg); + _code = (compile getText(_ehCfg >> "onCall")); + _eventHandlerCollection pushback [_classType, _code]; + true; + }; + }; + }; + missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; }; _return = []; { - _return pushback (_arguments call (_x select 1)); - false; + _return pushback (_arguments call (_x select 1)); + false; }count _eventHandlerCollection; _return diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 64439cebfe..d5185e6562 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -13,26 +13,26 @@ private ["_unit", "_curAnim", "_animation", "_cfg","_unitAnimation", "_animation _unit = _this select 0; if (vehicle _unit != _unit) exitwith { - _animation = ""; - _animationState = (animationState _unit); - _unitAnimation = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); - if (isText (_unitAnimation >> "actions")) then { - if ((vehicle _unit) != _unit) then { - _cfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); - if (isArray (_cfg >> "interpolateTo")) then { - _animation = getArray (_cfg >> "interpolateTo") select 0; - }; - } else { - _cfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimation >> "actions")) >> "die"); - if (isText _cfg) then { - _animation = getText _cfg; - }; - }; - }; - if (isnil "_animation") then { - _animation = ""; - }; - _animation; + _animation = ""; + _animationState = (animationState _unit); + _unitAnimation = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); + if (isText (_unitAnimation >> "actions")) then { + if ((vehicle _unit) != _unit) then { + _cfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); + if (isArray (_cfg >> "interpolateTo")) then { + _animation = getArray (_cfg >> "interpolateTo") select 0; + }; + } else { + _cfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimation >> "actions")) >> "die"); + if (isText _cfg) then { + _animation = getText _cfg; + }; + }; + }; + if (isnil "_animation") then { + _animation = ""; + }; + _animation; }; "Unconscious"; diff --git a/addons/common/functions/fnc_getDefinedVariable.sqf b/addons/common/functions/fnc_getDefinedVariable.sqf index 78b6d12370..6c10c4f682 100644 --- a/addons/common/functions/fnc_getDefinedVariable.sqf +++ b/addons/common/functions/fnc_getDefinedVariable.sqf @@ -17,17 +17,17 @@ private "_value"; _value = UNIT getvariable VARIABLE; if (isnil "_value") then { - if (count _this >2) then { - _value = _this select 2; - } else { - private "_definedVariable"; - _definedVariable = ([VARIABLE] call FUNC(getDefinedVariableInfo)); - if (count _definedVariable > 1) then { - _value = _definedVariable select 1; - }; - }; - if (isnil "_value") then { - _value = 0; - }; + if (count _this >2) then { + _value = _this select 2; + } else { + private "_definedVariable"; + _definedVariable = ([VARIABLE] call FUNC(getDefinedVariableInfo)); + if (count _definedVariable > 1) then { + _value = _definedVariable select 1; + }; + }; + if (isnil "_value") then { + _value = 0; + }; }; _value \ No newline at end of file diff --git a/addons/common/functions/fnc_getDefinedVariableDefault.sqf b/addons/common/functions/fnc_getDefinedVariableDefault.sqf index 1673ffb86c..cd4e4f08f2 100644 --- a/addons/common/functions/fnc_getDefinedVariableDefault.sqf +++ b/addons/common/functions/fnc_getDefinedVariableDefault.sqf @@ -13,7 +13,7 @@ private "_variableDefinition"; _variableDefinition = ([_this select 0] call FUNC(getDefinedVariableInfo)); if (count _variableDefinition > 0) exitwith { - _variableDefinition select 1; + _variableDefinition select 1; }; nil; \ No newline at end of file diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index f0ba265dfc..4cd493ec2c 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -19,26 +19,26 @@ _result = [false, [0, 0, 0]]; _distance = _source vectorDistance _destination; if (count (lineIntersectsWith [_source, _destination]) > 0) then { - _lower = 0; - _upper = 1; - _mid = 0.5; + _lower = 0; + _upper = 1; + _mid = 0.5; - _dir = _source vectorFromTo _destination; + _dir = _source vectorFromTo _destination; - while {(_upper - _lower) * _distance > _accuracy} do { - _mid = _lower + (_upper - _lower) / 2; + while {(_upper - _lower) * _distance > _accuracy} do { + _mid = _lower + (_upper - _lower) / 2; - _intersections = count (lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]); + _intersections = count (lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]); - if (_intersections > 0) then { - _upper = _mid; - } else { - _lower = _mid; - }; - }; + if (_intersections > 0) then { + _upper = _mid; + } else { + _lower = _mid; + }; + }; - _mid = _lower + (_upper - _lower) / 2; - _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + _mid = _lower + (_upper - _lower) / 2; + _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; }; _result diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 698f92a698..1b645bcdb2 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -19,26 +19,26 @@ _result = [false, [0, 0, 0]]; _distance = _source vectorDistance _destination; if (terrainIntersectASL [_source, _destination]) then { - _lower = 0; - _upper = 1; - _mid = 0.5; + _lower = 0; + _upper = 1; + _mid = 0.5; - _dir = _source vectorFromTo _destination; + _dir = _source vectorFromTo _destination; - while {(_upper - _lower) * _distance > _accuracy} do { - _mid = _lower + (_upper - _lower) / 2; + while {(_upper - _lower) * _distance > _accuracy} do { + _mid = _lower + (_upper - _lower) / 2; - _intersection = terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + _intersection = terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; - if (_intersection) then { - _upper = _mid; - } else { - _lower = _mid; - }; - }; + if (_intersection) then { + _upper = _mid; + } else { + _lower = _mid; + }; + }; - _mid = _lower + (_upper - _lower) / 2; - _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + _mid = _lower + (_upper - _lower) / 2; + _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; }; _result diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index 45c04e39cd..ec4e9b5755 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -16,13 +16,13 @@ _magazine = _this select 1; _return = 0; if (_unit isKindOf "CAManBase") then { - _return = {_x == _magazine} count magazines _unit; + _return = {_x == _magazine} count magazines _unit; } else { - { - _return = _return + {_x == _magazine} count magazines _x; - }foreach (crew _unit); + { + _return = _return + {_x == _magazine} count magazines _x; + }foreach (crew _unit); - _return = _return + ({_x == _magazine} count getMagazineCargo _unit); + _return = _return + ({_x == _magazine} count getMagazineCargo _unit); }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_getUnconsciousCondition.sqf b/addons/common/functions/fnc_getUnconsciousCondition.sqf index 6325f72a05..097a5682ec 100644 --- a/addons/common/functions/fnc_getUnconsciousCondition.sqf +++ b/addons/common/functions/fnc_getUnconsciousCondition.sqf @@ -14,16 +14,16 @@ private ["_unit","_return"]; _unit = _this select 0; if (isnil QGVAR(unconsciousConditions_F)) then { - GVAR(unconsciousConditions_F) = []; + GVAR(unconsciousConditions_F) = []; }; _return = false; { - if (typeName _x == typeName {}) then { - if (([_unit] call _x)) then { - _return = true; - }; - }; - if (_return) exitwith{}; + if (typeName _x == typeName {}) then { + if (([_unit] call _x)) then { + _return = true; + }; + }; + if (_return) exitwith{}; }foreach GVAR(unconsciousConditions_F); _return \ No newline at end of file diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index 110002c7d7..0157fab8e3 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -15,8 +15,8 @@ _unit = _this select 0; _magazine = _this select 1; if (_magazine != "") then { - _return = (_magazine in magazines _unit); + _return = (_magazine in magazines _unit); } else { - _return = false; + _return = false; }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_inWater_f.sqf b/addons/common/functions/fnc_inWater_f.sqf index af578f1782..ea511d388d 100644 --- a/addons/common/functions/fnc_inWater_f.sqf +++ b/addons/common/functions/fnc_inWater_f.sqf @@ -14,9 +14,9 @@ private ["_unit","_return","_aslPos"]; _unit = _this select 0; _return = false; if ((surfaceIsWater getPos _unit)) then { - _aslPos = _unit modelToWorld (_unit selectionPosition "head"); - if ((_aslPos select 2) <= 0) then { - _return = true; - }; + _aslPos = _unit modelToWorld (_unit selectionPosition "head"); + if ((_aslPos select 2) <= 0) then { + _return = true; + }; }; _return; \ No newline at end of file diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index b5741bd88d..6a39152b9b 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -19,8 +19,8 @@ if (configName _configEntry == ",") exitWith { false }; _match = false; while {configName _configEntry != ""} do { - if (configName _configEntry == _configMatch) exitWith { _match = true }; - _configEntry = inheritsFrom(_configEntry); + if (configName _configEntry == _configMatch) exitWith { _match = true }; + _configEntry = inheritsFrom(_configEntry); }; _match \ No newline at end of file diff --git a/addons/common/functions/fnc_insertionSort.sqf b/addons/common/functions/fnc_insertionSort.sqf index e92722d2cd..bdafa70592 100644 --- a/addons/common/functions/fnc_insertionSort.sqf +++ b/addons/common/functions/fnc_insertionSort.sqf @@ -14,21 +14,21 @@ private ["_list", "_ascending", "_tmp", "_i", "_j"]; _list = +(_this select 0); _ascending = true; if (count _this > 1) then { - _ascending = _this select 1; + _ascending = _this select 1; }; for "_i" from 1 to (count _list) - 1 do { - _tmp = _list select _i; - _j = _i; - while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { - _list set [_j, _list select (_j - 1)]; - _j = _j - 1; - }; - _list set[_j, _tmp]; + _tmp = _list select _i; + _j = _i; + while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { + _list set [_j, _list select (_j - 1)]; + _j = _j - 1; + }; + _list set[_j, _tmp]; }; if (!_ascending) then { - reverse _list; + reverse _list; }; _list \ No newline at end of file diff --git a/addons/common/functions/fnc_isHC.sqf b/addons/common/functions/fnc_isHC.sqf index 891f94343a..82a9d49ba2 100644 --- a/addons/common/functions/fnc_isHC.sqf +++ b/addons/common/functions/fnc_isHC.sqf @@ -13,12 +13,12 @@ private ["_return"]; if (!isMultiplayer) then { - _return = true; + _return = true; } else { - if (isServer && !isDedicated) then { - _return = true; - } else { - _return = !(hasInterface || isDedicated); - }; + if (isServer && !isDedicated) then { + _return = true; + } else { + _return = !(hasInterface || isDedicated); + }; }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_limitMovementSpeed.sqf b/addons/common/functions/fnc_limitMovementSpeed.sqf index e8e17eb21f..ad3d08c66c 100644 --- a/addons/common/functions/fnc_limitMovementSpeed.sqf +++ b/addons/common/functions/fnc_limitMovementSpeed.sqf @@ -14,40 +14,40 @@ private ["_unit","_carriedObj"]; _unit = _this select 0; _fallDown = false; if (count _this > 1) then { - _fallDown = _this select 1; + _fallDown = _this select 1; }; if ((_unit getvariable [QGVAR(limitMovementSpeed),false])) exitwith { - _unit setvariable [QGVAR(limitMovementSpeed),nil,true]; + _unit setvariable [QGVAR(limitMovementSpeed),nil,true]; }; [{ - private["_unit","_fallDown","_carriedObj"]; - _unit = (_this select 0) select 0; - _fallDown = (_this select 0) select 1; + private["_unit","_fallDown","_carriedObj"]; + _unit = (_this select 0) select 0; + _fallDown = (_this select 0) select 1; - _carriedObj = [_unit] call FUNC(getCarriedObj); + _carriedObj = [_unit] call FUNC(getCarriedObj); - if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - if !((!isNull _carriedObj) && (alive _unit)) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + if !((!isNull _carriedObj) && (alive _unit)) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; - if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then { + if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then { - _unit setVelocity [0,0,0]; + _unit setVelocity [0,0,0]; - if (_fallDown) then { - _unit playMove "amovppnemstpsraswrfldnon"; - }; + if (_fallDown) then { + _unit playMove "amovppnemstpsraswrfldnon"; + }; - if (_carriedObj isKindOf "Man") then { - hint "You can not move this fast while transporting this person."; - } else { - hint "You can not move this fast while carrying this object"; - }; - [_unit,ObjNull] call FUNC(carryObj); - }; + if (_carriedObj isKindOf "Man") then { + hint "You can not move this fast while transporting this person."; + } else { + hint "You can not move this fast while carrying this object"; + }; + [_unit,ObjNull] call FUNC(carryObj); + }; }, 0.5, [_unit,_fallDown] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_loadPersonLocal_f.sqf b/addons/common/functions/fnc_loadPersonLocal_f.sqf index bae5aaa804..dbba09111a 100644 --- a/addons/common/functions/fnc_loadPersonLocal_f.sqf +++ b/addons/common/functions/fnc_loadPersonLocal_f.sqf @@ -16,7 +16,7 @@ _vehicle = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; _caller = [_this, 2, ObjNull,[ObjNull]] call BIS_fnc_Param; if (!alive _unit) then { - _unit = [_unit,_caller] call FUNC(makeCopyOfBody_F); + _unit = [_unit,_caller] call FUNC(makeCopyOfBody_F); }; _unit moveInCargo _vehicle; @@ -24,16 +24,16 @@ _loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; _loaded pushback _unit; _vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; if (!([_unit] call FUNC(isAwake))) then { - _handle = [_unit,_vehicle] spawn { - private ["_unit","_vehicle"]; - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit == _vehicle}; - sleep 0.5; - [_unit,([_unit] call FUNC(getDeathAnim)), 1] call FUNC(doAnimation); - }; + _handle = [_unit,_vehicle] spawn { + private ["_unit","_vehicle"]; + _unit = _this select 0; + _vehicle = _this select 1; + waituntil {vehicle _unit == _vehicle}; + sleep 0.5; + [_unit,([_unit] call FUNC(getDeathAnim)), 1] call FUNC(doAnimation); + }; } else { - if ([_unit] call FUNC(isArrested)) then { + if ([_unit] call FUNC(isArrested)) then { - }; + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_loadPerson_f.sqf b/addons/common/functions/fnc_loadPerson_f.sqf index d668b42846..5944879c62 100644 --- a/addons/common/functions/fnc_loadPerson_f.sqf +++ b/addons/common/functions/fnc_loadPerson_f.sqf @@ -21,22 +21,22 @@ if (!([_caller] call FUNC(canInteract)) || {_caller == _unit}) exitwith {_vehicl _loadcar = nearestObject [_unit, "car"]; if (_unit distance _loadcar <= 10) then { - _vehicle = _loadcar; + _vehicle = _loadcar; } else { - _loadhelicopter = nearestObject [_unit, "air"]; - if (_unit distance _loadhelicopter <= 10) then { - _vehicle = _loadhelicopter; - } else { - _loadtank = nearestObject [_unit, "tank"]; - if (_unit distance _loadtank <= 10) then { - _vehicle = _loadtank; - }; - }; + _loadhelicopter = nearestObject [_unit, "air"]; + if (_unit distance _loadhelicopter <= 10) then { + _vehicle = _loadhelicopter; + } else { + _loadtank = nearestObject [_unit, "tank"]; + if (_unit distance _loadtank <= 10) then { + _vehicle = _loadtank; + }; + }; }; if (!isNull _vehicle) then { - [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); - [_caller,objNull] call FUNC(carryObj); - [_unit,objNull] call FUNC(carryObj); - [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal_F)), _unit, false] call EFUNC(common,execRemoteFnc); + [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); + [_caller,objNull] call FUNC(carryObj); + [_unit,objNull] call FUNC(carryObj); + [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal_F)), _unit, false] call EFUNC(common,execRemoteFnc); }; _vehicle \ No newline at end of file diff --git a/addons/common/functions/fnc_makeCopyOfBody_f.sqf b/addons/common/functions/fnc_makeCopyOfBody_f.sqf index 987d9af630..498e8a2168 100644 --- a/addons/common/functions/fnc_makeCopyOfBody_f.sqf +++ b/addons/common/functions/fnc_makeCopyOfBody_f.sqf @@ -14,62 +14,62 @@ private ["_oldBody","_newUnit","_class","_group","_position","_side","_allVariab _oldBody = _this select 0; _caller = _this select 1; - if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies - _name = _oldBody getvariable [QGVAR(name),"unknown"]; - _class = typeof _oldBody; - _side = side _caller; - _group = createGroup _side; - _position = getPos _oldBody; + if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies + _name = _oldBody getvariable [QGVAR(name),"unknown"]; + _class = typeof _oldBody; + _side = side _caller; + _group = createGroup _side; + _position = getPos _oldBody; - _newUnit = _group createUnit [typeof _oldBody, _position, [], 0, "NONE"]; + _newUnit = _group createUnit [typeof _oldBody, _position, [], 0, "NONE"]; - _allVariables = [_oldBody] call FUNC(getAllDefinedSetVariables); - // [NAME (STRING), TYPENAME (STRING), VALUE (ANY), DEFAULT GLOBAL (BOOLEAN)] - { - [_newUnit,_x select 0, _x select 2] call FUNC(setDefinedVariable); - }foreach _allVariables; - _newUnit setVariable [QGVAR(name),_name,true]; + _allVariables = [_oldBody] call FUNC(getAllDefinedSetVariables); + // [NAME (STRING), TYPENAME (STRING), VALUE (ANY), DEFAULT GLOBAL (BOOLEAN)] + { + [_newUnit,_x select 0, _x select 2] call FUNC(setDefinedVariable); + }foreach _allVariables; + _newUnit setVariable [QGVAR(name),_name,true]; - _newUnit disableAI "TARGET"; - _newUnit disableAI "AUTOTARGET"; - _newUnit disableAI "MOVE"; - _newUnit disableAI "ANIM"; - _newUnit disableAI "FSM"; - _newUnit setvariable [QGVAR(isDead),true,true]; + _newUnit disableAI "TARGET"; + _newUnit disableAI "AUTOTARGET"; + _newUnit disableAI "MOVE"; + _newUnit disableAI "ANIM"; + _newUnit disableAI "FSM"; + _newUnit setvariable [QGVAR(isDead),true,true]; - removeallweapons _newUnit; - removeallassigneditems _newUnit; - removeUniform _newUnit; - removeHeadgear _newUnit; - removeBackpack _newUnit; - removeVest _newUnit; + removeallweapons _newUnit; + removeallassigneditems _newUnit; + removeUniform _newUnit; + removeHeadgear _newUnit; + removeBackpack _newUnit; + removeVest _newUnit; - _newUnit addHeadgear (headgear _oldBody); - _newUnit addBackpack (backpack _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); + _newUnit addHeadgear (headgear _oldBody); + _newUnit addBackpack (backpack _oldBody); + clearItemCargoGlobal (backpackContainer _newUnit); + clearMagazineCargoGlobal (backpackContainer _newUnit); + clearWeaponCargoGlobal (backpackContainer _newUnit); - _newUnit addVest (vest _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); + _newUnit addVest (vest _oldBody); + clearItemCargoGlobal (backpackContainer _newUnit); + clearMagazineCargoGlobal (backpackContainer _newUnit); + clearWeaponCargoGlobal (backpackContainer _newUnit); - _newUnit addUniform (uniform _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); + _newUnit addUniform (uniform _oldBody); + clearItemCargoGlobal (backpackContainer _newUnit); + clearMagazineCargoGlobal (backpackContainer _newUnit); + clearWeaponCargoGlobal (backpackContainer _newUnit); - {_newUnit addMagazine _x} count (magazines _oldBody); - {_newUnit addWeapon _x} count (weapons _oldBody); - {_newUnit addItem _x} count (items _oldBody); + {_newUnit addMagazine _x} count (magazines _oldBody); + {_newUnit addWeapon _x} count (weapons _oldBody); + {_newUnit addItem _x} count (items _oldBody); - _newUnit selectWeapon (primaryWeapon _newUnit); - //_newUnit playMoveNow ([_newUnit] call FUNC(getDeathAnim)); + _newUnit selectWeapon (primaryWeapon _newUnit); + //_newUnit playMoveNow ([_newUnit] call FUNC(getDeathAnim)); - deleteVehicle _oldBody; + deleteVehicle _oldBody; - // TODO sometimes the old body does not get cleaned up properly. Look into garbage collection. + // TODO sometimes the old body does not get cleaned up properly. Look into garbage collection. - _newUnit setDamage 0.9; + _newUnit setDamage 0.9; _newUnit \ No newline at end of file diff --git a/addons/common/functions/fnc_moduleBasicRevive.sqf b/addons/common/functions/fnc_moduleBasicRevive.sqf index 9b6bfd5ba6..6d8bfa2e6c 100644 --- a/addons/common/functions/fnc_moduleBasicRevive.sqf +++ b/addons/common/functions/fnc_moduleBasicRevive.sqf @@ -20,5 +20,5 @@ GVAR(Module) = true; [_logic, QGVAR(REVIVE_NUMBER_MAX_F), "amountOf" ] call EFUNC(common,readNumericParameterFromModule); [ - {(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD_F),0]) > 0)} + {(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD_F),0]) > 0)} ] call FUNC(registerUnconsciousCondition); diff --git a/addons/common/functions/fnc_moveToTempGroup.sqf b/addons/common/functions/fnc_moveToTempGroup.sqf index e717071153..b146e67ef3 100644 --- a/addons/common/functions/fnc_moveToTempGroup.sqf +++ b/addons/common/functions/fnc_moveToTempGroup.sqf @@ -15,18 +15,18 @@ _unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; _moveTo = [_this, 1,false,[false]] call BIS_fnc_Param; if (_moveTo) then { - _previousGroup = group _unit; - _newGroup = createGroup (side _previousGroup); - [_unit] joinSilent _newGroup; - _unit setvariable [QGVAR(previousGroup_F),_previousGroup]; + _previousGroup = group _unit; + _newGroup = createGroup (side _previousGroup); + [_unit] joinSilent _newGroup; + _unit setvariable [QGVAR(previousGroup_F),_previousGroup]; } else { - _previousGroup = _unit getvariable QGVAR(previousGroup_F); - if (!isnil "_previousGroup") then { - _currentGroup = group _unit; - _unit setvariable [QGVAR(previousGroup_F),nil]; - [_unit] joinSilent _previousGroup; - if (count units _currentGroup == 0) then { - deleteGroup _currentGroup; - }; - }; + _previousGroup = _unit getvariable QGVAR(previousGroup_F); + if (!isnil "_previousGroup") then { + _currentGroup = group _unit; + _unit setvariable [QGVAR(previousGroup_F),nil]; + [_unit] joinSilent _previousGroup; + if (count units _currentGroup == 0) then { + deleteGroup _currentGroup; + }; + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index 081a79bfdd..aa3ae8fb45 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -16,23 +16,23 @@ _accepted = _this select 2; _info = _unit getvariable _id; if (!isnil "_info") then { - _caller = _info select 0; - _target = _info select 1; - _requestID = _info select 2; - _requestMessage = _info select 3; - _callBack = _info select 4; - _replyParams = [_info, _accepted]; - [_replyParams, QUOTE(FUNC(requestCallback)), _caller, false] call FUNC(execRemoteFnc); - _unit setvariable [_id, nil]; + _caller = _info select 0; + _target = _info select 1; + _requestID = _info select 2; + _requestMessage = _info select 3; + _callBack = _info select 4; + _replyParams = [_info, _accepted]; + [_replyParams, QUOTE(FUNC(requestCallback)), _caller, false] call FUNC(execRemoteFnc); + _unit setvariable [_id, nil]; }; GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { - _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); - GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; + _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); + GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; }; if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { - _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); - GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; + _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); + GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; }; diff --git a/addons/common/functions/fnc_raiseScriptedEvent_f.sqf b/addons/common/functions/fnc_raiseScriptedEvent_f.sqf index e5c9ac2361..a4ea604f28 100644 --- a/addons/common/functions/fnc_raiseScriptedEvent_f.sqf +++ b/addons/common/functions/fnc_raiseScriptedEvent_f.sqf @@ -19,46 +19,46 @@ _handle = _this select 1; _eventHandlerName = (QGVAR(f_custom_eventhandlers_) + _handle); _eventHandlerCollection = missionNamespace getvariable _eventHandlerName; if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - [format["caching Custom Eventhandler: %1",_handle]] call FUNC(debug); - _cfg = (ConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; + _eventHandlerCollection = []; + [format["caching Custom Eventhandler: %1",_handle]] call FUNC(debug); + _cfg = (ConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); + if (isClass _cfg) then { + _numberOfEH = count _cfg; - for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { - //for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { - _ehCfg = _cfg select _EHiterator; - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _code = (compile getText(_ehCfg >> "onCall")); - _eventHandlerCollection pushback [_classType, _code]; - true; - }; - }; - }; + for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { + //for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { + _ehCfg = _cfg select _EHiterator; + if (isClass _ehCfg) then { + _classType = (ConfigName _ehCfg); + _code = (compile getText(_ehCfg >> "onCall")); + _eventHandlerCollection pushback [_classType, _code]; + true; + }; + }; + }; - _cfg = (MissionConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { - //for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { - _ehCfg = _cfg select _EHiterator; - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _code = (compile getText(_ehCfg >> "onCall")); - _eventHandlerCollection pushback [_classType, _code]; - true; - }; - }; - }; + _cfg = (MissionConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); + if (isClass _cfg) then { + _numberOfEH = count _cfg; + for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { + //for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { + _ehCfg = _cfg select _EHiterator; + if (isClass _ehCfg) then { + _classType = (ConfigName _ehCfg); + _code = (compile getText(_ehCfg >> "onCall")); + _eventHandlerCollection pushback [_classType, _code]; + true; + }; + }; + }; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; - [format["Custom Eventhandler: %1 cache: %2",_handle, _eventHandlerCollection]] call FUNC(debug); + missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; + [format["Custom Eventhandler: %1 cache: %2",_handle, _eventHandlerCollection]] call FUNC(debug); }; _return = []; { - _return pushback (_arguments call (_x select 1)); + _return pushback (_arguments call (_x select 1)); }foreach _eventHandlerCollection; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index b2281e338e..c74a69013d 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -22,23 +22,23 @@ _requestID = ("ace_recieveRequest_f_id_"+_requestID); _target setvariable [_requestID, _this]; if (isLocalized _requestMessage) then { - _requestMessage = format[localize _requestMessage,[_caller] call FUNC(getName)]; + _requestMessage = format[localize _requestMessage,[_caller] call FUNC(getName)]; } else { - _requestMessage = format[_requestMessage,[_caller] call FUNC(getName)]; + _requestMessage = format[_requestMessage,[_caller] call FUNC(getName)]; }; hint format["%1",_requestMessage]; if !(isnil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then { - terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT); + terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT); }; if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { - _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); - GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); + GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; }; if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { - _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); - GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); + GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; }; GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = _target addAction ["Accept", compile format["[player,'%1', true] call FUNC(onAnswerRequest);", _requestID]]; @@ -47,23 +47,23 @@ GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = _target addAction ["Decline", compile GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = _requestID; GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { - _t = (_this select 0) + 40; - _target = _this select 1; - _requestID = _this select 2; - _id = _target getvariable _requestID; - waituntil { - _id = _target getvariable _requestID; + _t = (_this select 0) + 40; + _target = _this select 1; + _requestID = _this select 2; + _id = _target getvariable _requestID; + waituntil { + _id = _target getvariable _requestID; - (time > _t || isnil "_id")}; - _target setvariable [_requestID, nil]; - GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; - if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { - _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); - GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; - }; - if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { - _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); - GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; - }; + (time > _t || isnil "_id")}; + _target setvariable [_requestID, nil]; + GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; + if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); + GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; + }; + if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); + GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_registerUnconsciousCondition.sqf b/addons/common/functions/fnc_registerUnconsciousCondition.sqf index a312bb21e3..f34d05b57d 100644 --- a/addons/common/functions/fnc_registerUnconsciousCondition.sqf +++ b/addons/common/functions/fnc_registerUnconsciousCondition.sqf @@ -11,12 +11,12 @@ #include "script_component.hpp" if (isnil QGVAR(unconsciousConditions_F)) then { - GVAR(unconsciousConditions_F) = []; + GVAR(unconsciousConditions_F) = []; }; if (typeName _this == typeName []) then { - { - if (typeName _x == typeName {}) then { - GVAR(unconsciousConditions_F) pushback _x; - }; - }foreach _this; + { + if (typeName _x == typeName {}) then { + GVAR(unconsciousConditions_F) pushback _x; + }; + }foreach _this; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_resetAllDefaults_f.sqf b/addons/common/functions/fnc_resetAllDefaults_f.sqf index 368ee32318..571526dbf6 100644 --- a/addons/common/functions/fnc_resetAllDefaults_f.sqf +++ b/addons/common/functions/fnc_resetAllDefaults_f.sqf @@ -17,22 +17,22 @@ _unit setvariable [QGVAR(isDead),nil,true]; _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { - [true] call FUNC(setVolume_f); - [false] call FUNC(disableKeyInput_f); - [false] call EFUNC(GUI,effectBlackOut); + [true] call FUNC(setVolume_f); + [false] call FUNC(disableKeyInput_f); + [false] call EFUNC(GUI,effectBlackOut); - if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { - // clear all disable user input - { - [_X, false] call FUNC(setDisableUserInputStatus); - }foreach GVAR(DISABLE_USER_INPUT_COLLECTION_F); - }; + if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { + // clear all disable user input + { + [_X, false] call FUNC(setDisableUserInputStatus); + }foreach GVAR(DISABLE_USER_INPUT_COLLECTION_F); + }; }; { - if (!(_x select 4)) then { - _unit setvariable [(_x select 0),nil,_x select 3]; - }; + if (!(_x select 4)) then { + _unit setvariable [(_x select 0),nil,_x select 3]; + }; }foreach ([_unit] call FUNC(getAllDefinedSetVariables)); [[_unit],"resetToDefaults"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_revealObject_f.sqf b/addons/common/functions/fnc_revealObject_f.sqf index 0e45dea75d..9c5a34f59a 100644 --- a/addons/common/functions/fnc_revealObject_f.sqf +++ b/addons/common/functions/fnc_revealObject_f.sqf @@ -1,5 +1,15 @@ +/** + * fnc_revealObject_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + #include "script_component.hpp" if (hasInterface) then { - player reveal (_this select 0); + player reveal (_this select 0); }; \ No newline at end of file diff --git a/addons/common/functions/fnc_sendRequest_f.sqf b/addons/common/functions/fnc_sendRequest_f.sqf index fe0a3c29e0..fdd88716e9 100644 --- a/addons/common/functions/fnc_sendRequest_f.sqf +++ b/addons/common/functions/fnc_sendRequest_f.sqf @@ -18,9 +18,9 @@ _requestMessage = _this select 3; _callBack = _this select 4; if (isPlayer _target) then { - // Pass request on to target locality for player accept/decline. - [[_caller, _target, _requestID, _requestMessage, _callBack], QUOTE(FUNC(receiveRequest)), _target, false] call EFUNC(common,execRemoteFnc); + // Pass request on to target locality for player accept/decline. + [[_caller, _target, _requestID, _requestMessage, _callBack], QUOTE(FUNC(receiveRequest)), _target, false] call EFUNC(common,execRemoteFnc); } else { - // accept it, since it's an AI. - [_caller, _target, true] call compile _callBack; + // accept it, since it's an AI. + [_caller, _target, true] call compile _callBack; }; diff --git a/addons/common/functions/fnc_setArrestState.sqf b/addons/common/functions/fnc_setArrestState.sqf index ba4e91a4d1..d32ccc5098 100644 --- a/addons/common/functions/fnc_setArrestState.sqf +++ b/addons/common/functions/fnc_setArrestState.sqf @@ -15,31 +15,31 @@ _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; _setArrest = [_this, 1, false, [false]] call BIS_fnc_Param; if (_setArrest) then { - [_unit, QGVAR(StateArrested), true] call FUNC(setDefinedVariable); + [_unit, QGVAR(StateArrested), true] call FUNC(setDefinedVariable); - if ([_unit] call FUNC(isAwake)) then { - if (vehicle _unit == _unit) then { - [_unit,"UnaErcPoslechVelitele2",1] call FUNC(doAnimation); - }; - }; - if (IsPlayer _unit) then { - [["arrested", true],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); - }; - _unit disableAI "Move"; - _unit disableAI "ANIM"; + if ([_unit] call FUNC(isAwake)) then { + if (vehicle _unit == _unit) then { + [_unit,"UnaErcPoslechVelitele2",1] call FUNC(doAnimation); + }; + }; + if (IsPlayer _unit) then { + [["arrested", true],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); + }; + _unit disableAI "Move"; + _unit disableAI "ANIM"; } else { - [_unit, QGVAR(StateArrested), false] call FUNC(setDefinedVariable); + [_unit, QGVAR(StateArrested), false] call FUNC(setDefinedVariable); - if ([_unit] call FUNC(isAwake)) then { - if (vehicle _unit == _unit) then { - [_unit,"",1] call FUNC(doAnimation); - }; - _unit enableAI "Move"; - _unit enableAI "ANIM"; - }; - if (IsPlayer _unit) then { - [["arrested", false],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); - }; + if ([_unit] call FUNC(isAwake)) then { + if (vehicle _unit == _unit) then { + [_unit,"",1] call FUNC(doAnimation); + }; + _unit enableAI "Move"; + _unit enableAI "ANIM"; + }; + if (IsPlayer _unit) then { + [["arrested", false],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); + }; }; [[_unit, _setArrest],"setArrestState"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_setCanInteract.sqf b/addons/common/functions/fnc_setCanInteract.sqf index 6dd3860edd..091bbf8cc6 100644 --- a/addons/common/functions/fnc_setCanInteract.sqf +++ b/addons/common/functions/fnc_setCanInteract.sqf @@ -15,14 +15,14 @@ _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; _to = _this select 1; _return = false; if (((typeName _to) == "SCALAR")) then { - if (_to <-1) then { - _to = -1; - } else { - if (_to > 1) then { - _to = 1; - }; - }; - _unit setvariable [QGVAR(canInteract), ([_unit] call FUNC(getCanInteract)) + _to,false]; - _return = true; + if (_to <-1) then { + _to = -1; + } else { + if (_to > 1) then { + _to = 1; + }; + }; + _unit setvariable [QGVAR(canInteract), ([_unit] call FUNC(getCanInteract)) + _to,false]; + _return = true; }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_setCaptiveSwitch.sqf b/addons/common/functions/fnc_setCaptiveSwitch.sqf index ec45007e8b..378f42e5d4 100644 --- a/addons/common/functions/fnc_setCaptiveSwitch.sqf +++ b/addons/common/functions/fnc_setCaptiveSwitch.sqf @@ -17,17 +17,17 @@ _setCaptive = [_this, 1, false, [false]] call BIS_fnc_Param; _captiveSwitch = true; if (_setCaptive) then { - if (captive _unit) then { - _captiveSwitch = false; - } else { - _unit setCaptive true; - }; + if (captive _unit) then { + _captiveSwitch = false; + } else { + _unit setCaptive true; + }; } else { - if (captive _unit) then { - _unit setCaptive false; - } else { - _captiveSwitch = false; - }; + if (captive _unit) then { + _unit setCaptive false; + } else { + _captiveSwitch = false; + }; }; _captiveSwitch \ No newline at end of file diff --git a/addons/common/functions/fnc_setCarriedBy.sqf b/addons/common/functions/fnc_setCarriedBy.sqf index 960bcab7d3..2ea5f3f469 100644 --- a/addons/common/functions/fnc_setCarriedBy.sqf +++ b/addons/common/functions/fnc_setCarriedBy.sqf @@ -4,7 +4,7 @@ * @Author: Glowbal * * @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT] - * @Return: BOOL True if succesfully registered + * @Return: BOOL True if succesfully registered * @PublicAPI: false */ @@ -15,7 +15,7 @@ _unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; _to = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; _return = false; if ((isNull ([_unit] call FUNC(getCarriedBy))) || isNull _to) then { - _return = true; - _unit setvariable [QGVAR(carriedBy),_to,true]; + _return = true; + _unit setvariable [QGVAR(carriedBy),_to,true]; }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_setDead.sqf b/addons/common/functions/fnc_setDead.sqf index f324d5fbc6..1b24a0552e 100644 --- a/addons/common/functions/fnc_setDead.sqf +++ b/addons/common/functions/fnc_setDead.sqf @@ -10,77 +10,77 @@ #include "script_component.hpp" -#define TIME_BETWEEN_REVIVE_RUNS 0.5 +#define TIME_BETWEEN_REVIVE_RUNS 0.5 private ["_unit"]; _unit = _this select 0; _force = false; if (count _this >= 2) then { - _force = _this select 1; + _force = _this select 1; }; if (!alive _unit) exitwith{}; if (!local _unit) exitwith { - [[_unit, _force], QUOTE(FUNC(setDead)), _unit, false] call BIS_fnc_MP; + [[_unit, _force], QUOTE(FUNC(setDead)), _unit, false] call BIS_fnc_MP; }; if (isnil QGVAR(ENABLE_REVIVE_F)) then { - GVAR(ENABLE_REVIVE_F) = 0; + GVAR(ENABLE_REVIVE_F) = 0; }; if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == 2)) && !_force && (alive (vehicle _unit))) exitwith { - // enter revive state - _unit setvariable [QGVAR(inReviveState), true, true]; + // enter revive state + _unit setvariable [QGVAR(inReviveState), true, true]; - // Remain unconscious while in revive state - [_unit] call FUNC(setUnconsciousState); + // Remain unconscious while in revive state + [_unit] call FUNC(setUnconsciousState); - // setting the revive default values - if (isnil QGVAR(REVIVE_TIMER_F)) then { - GVAR(REVIVE_TIMER_F) = 10; - }; - if (isnil QGVAR(REVIVE_NUMBER_MAX_F)) then { - GVAR(REVIVE_NUMBER_MAX_F) = -1; - }; + // setting the revive default values + if (isnil QGVAR(REVIVE_TIMER_F)) then { + GVAR(REVIVE_TIMER_F) = 10; + }; + if (isnil QGVAR(REVIVE_NUMBER_MAX_F)) then { + GVAR(REVIVE_NUMBER_MAX_F) = -1; + }; - [{ - private ["_unit","_playerDead","_counter"]; - _unit = (_this select 0) select 0; - _playerDead = (_this select 0) select 1; + [{ + private ["_unit","_playerDead","_counter"]; + _unit = (_this select 0) select 0; + _playerDead = (_this select 0) select 1; - // Check if a unit woke up or was already killed - if (!([_unit] call FUNC(isUnconscious)) || !alive _unit) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + // Check if a unit woke up or was already killed + if (!([_unit] call FUNC(isUnconscious)) || !alive _unit) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; - // Cleaning up the variables, as we no longer need them. - _unit setvariable [QGVAR(reviveCounter_f), nil]; - _unit setvariable [QGVAR(inReviveState), nil, true]; - }; + // Cleaning up the variables, as we no longer need them. + _unit setvariable [QGVAR(reviveCounter_f), nil]; + _unit setvariable [QGVAR(inReviveState), nil, true]; + }; - _counter = _unit getvariable [QGVAR(reviveCounter_f), 0]; - if (_counter >= GVAR(REVIVE_TIMER_F)) exitwith{ - if (isPlayer _unit) then { - titleText ["You died..","PLAIN DOWN"]; - }; - [_unit,QGVAR(isDead), true, true] call FUNC(setDefinedVariable); - if (_playerDead) then { - [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); - }; + _counter = _unit getvariable [QGVAR(reviveCounter_f), 0]; + if (_counter >= GVAR(REVIVE_TIMER_F)) exitwith{ + if (isPlayer _unit) then { + titleText ["You died..","PLAIN DOWN"]; + }; + [_unit,QGVAR(isDead), true, true] call FUNC(setDefinedVariable); + if (_playerDead) then { + [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); + }; - _unit setdamage 1; // killing a unit will automatically clean up all variables. + _unit setdamage 1; // killing a unit will automatically clean up all variables. - [[_unit, true],"killed"] call FUNC(raiseScriptedEvent_f); - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - _unit setvariable [QGVAR(reviveCounter_f),_counter + TIME_BETWEEN_REVIVE_RUNS]; + [[_unit, true],"killed"] call FUNC(raiseScriptedEvent_f); + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + _unit setvariable [QGVAR(reviveCounter_f),_counter + TIME_BETWEEN_REVIVE_RUNS]; - }, TIME_BETWEEN_REVIVE_RUNS, [_unit, isPlayer _unit] ] call CBA_fnc_addPerFrameHandler; + }, TIME_BETWEEN_REVIVE_RUNS, [_unit, isPlayer _unit] ] call CBA_fnc_addPerFrameHandler; }; [_unit,QGVAR(isDead),true,true] call FUNC(setDefinedVariable); if (isPLayer _unit) then { - [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); + [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); }; _unit setdamage 1; diff --git a/addons/common/functions/fnc_setDefinedVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf index 72bf234e58..b2eece4424 100644 --- a/addons/common/functions/fnc_setDefinedVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -17,15 +17,15 @@ _value = _this select 2; _global = false; if (count _this > 3) then { - _global = _this select 3; + _global = _this select 3; } else { - _definedVariable = ([_variable] call FUNC(getDefinedVariableInfo)); - if (count _definedVariable > 2) then { - _global = _definedVariable select 2; - }; + _definedVariable = ([_variable] call FUNC(getDefinedVariableInfo)); + if (count _definedVariable > 2) then { + _global = _definedVariable select 2; + }; }; if (!isNil "_value") exitwith { - _unit setvariable [_variable, _value, _global]; + _unit setvariable [_variable, _value, _global]; }; _unit setvariable [_variable, nil, _global]; \ No newline at end of file diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf index 08dd161e2e..2451cbe90f 100644 --- a/addons/common/functions/fnc_setDisableUserInputStatus.sqf +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -14,15 +14,15 @@ _disable = _this select 1; if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { - GVAR(DISABLE_USER_INPUT_COLLECTION_F) = []; + GVAR(DISABLE_USER_INPUT_COLLECTION_F) = []; }; if (_disable) then { - GVAR(DISABLE_USER_INPUT_COLLECTION_F) pushback _id; - [true] call FUNC(disableUserInput); + GVAR(DISABLE_USER_INPUT_COLLECTION_F) pushback _id; + [true] call FUNC(disableUserInput); } else { - GVAR(DISABLE_USER_INPUT_COLLECTION_F) = GVAR(DISABLE_USER_INPUT_COLLECTION_F) - [_id]; - if (GVAR(DISABLE_USER_INPUT_COLLECTION_F) isEqualTo []) then { - [false] call FUNC(disableUserInput); - }; + GVAR(DISABLE_USER_INPUT_COLLECTION_F) = GVAR(DISABLE_USER_INPUT_COLLECTION_F) - [_id]; + if (GVAR(DISABLE_USER_INPUT_COLLECTION_F) isEqualTo []) then { + [false] call FUNC(disableUserInput); + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 2e7bd972a0..26d8ca98ac 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -15,26 +15,26 @@ _id = _this select 0; _settings = _this select 1; _add = true; if (count _this > 2) then { - _add = _this select 2; + _add = _this select 2; }; _map = missionNamespace getVariable [QGVAR(setHearingCapabilityMap),[]]; _exists = false; { - if (_id == _x select 0) exitWith { - _exists = true; - if (_add) then { - _x set [1, _settings]; - } else { - _map set [_forEachIndex, 0]; - _map = _map - [0]; - }; - }; + if (_id == _x select 0) exitWith { + _exists = true; + if (_add) then { + _x set [1, _settings]; + } else { + _map set [_forEachIndex, 0]; + _map = _map - [0]; + }; + }; } forEach _map; if (!_exists && _add) then { - _map pushBack [_id, _settings]; + _map pushBack [_id, _settings]; }; missionNamespace setVariable [QGVAR(setHearingCapabilityMap), _map]; @@ -42,7 +42,7 @@ missionNamespace setVariable [QGVAR(setHearingCapabilityMap), _map]; // find lowest volume _lowestVolume = 1; { - _lowestVolume = (_x select 1) min _lowestVolume; + _lowestVolume = (_x select 1) min _lowestVolume; } forEach _map; // in game sounds diff --git a/addons/common/functions/fnc_setProne.sqf b/addons/common/functions/fnc_setProne.sqf index 9602460bd6..b456c5094a 100644 --- a/addons/common/functions/fnc_setProne.sqf +++ b/addons/common/functions/fnc_setProne.sqf @@ -13,16 +13,16 @@ private ["_unit"]; _unit = [_this,0, ObjNull,[ObjNull]] call BIS_fnc_Param; switch (currentWeapon _unit) do { - case (primaryWeapon _unit): { - [_unit,"amovppnemstpsraswrfldnon"] call FUNC(localAnim); - }; - case (secondaryWeapon _unit): { - [_unit,"amovppnemstpsraswlnrdnon"] call FUNC(localAnim); - }; - case (handgunWeapon _unit): { - [_unit,"AmovPpneMstpSrasWpstDnon"] call FUNC(localAnim); - }; - default { - [_unit,"amovppnemstpsnonwnondnon"] call FUNC(localAnim); - }; + case (primaryWeapon _unit): { + [_unit,"amovppnemstpsraswrfldnon"] call FUNC(localAnim); + }; + case (secondaryWeapon _unit): { + [_unit,"amovppnemstpsraswlnrdnon"] call FUNC(localAnim); + }; + case (handgunWeapon _unit): { + [_unit,"AmovPpneMstpSrasWpstDnon"] call FUNC(localAnim); + }; + default { + [_unit,"amovppnemstpsnonwnondnon"] call FUNC(localAnim); + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_setUnconsciousState.sqf b/addons/common/functions/fnc_setUnconsciousState.sqf index c86ed36ba7..bae01b291c 100644 --- a/addons/common/functions/fnc_setUnconsciousState.sqf +++ b/addons/common/functions/fnc_setUnconsciousState.sqf @@ -14,13 +14,13 @@ private ["_unit", "_animState", "_dAnim"]; _unit = _this select 0; if !([_unit] call FUNC(canGoUnconsciousState)) exitwith{ - [format["Exit setUnconscious: %1", _this]] call FUNC(debug); + [format["Exit setUnconscious: %1", _this]] call FUNC(debug); }; // We only want this function to work on local machines if (!local _unit) exitwith { - [[_unit], QUOTE(FUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); - [format["Exit setUnconscious: %1", _this]] call FUNC(debug); + [[_unit], QUOTE(FUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); + [format["Exit setUnconscious: %1", _this]] call FUNC(debug); }; // get rid of the object we are carrying, before we go unconscious. @@ -41,13 +41,13 @@ _originalPos = unitPos _unit; // Handle the on screen effects if (isPlayer _unit) then { - [] call FUNC(closeAllDialogs_f); - [true] call EFUNC(GUI,effectBlackOut); - ["unconscious", true] call FUNC(setDisableUserInputStatus); - [false] call FUNC(setVolume_f); + [] call FUNC(closeAllDialogs_f); + [true] call EFUNC(GUI,effectBlackOut); + ["unconscious", true] call FUNC(setDisableUserInputStatus); + [false] call FUNC(setVolume_f); } else { - _unit setUnitPos "DOWN"; - [_unit, true] call FUNC(disableAI_F); + _unit setUnitPos "DOWN"; + [_unit, true] call FUNC(disableAI_F); }; // So the AI does not get stuck, we are moving the unit to a temp group on its own. @@ -64,78 +64,78 @@ _startingTime = time; _minWaitingTime = (round(random(10)+5)); [{ - private ["_unit", "_vehicleOfUnit","_lockSwitch","_minWaitingTime", "_oldAnimation", "_captiveSwitch"]; - _args = _this select 0; - _unit = _args select 0; - _oldAnimation = _args select 1; - _captiveSwitch = _args select 2; - _originalPos = _args select 3; - _startingTime = _args select 4; - _minWaitingTime = _args select 5; + private ["_unit", "_vehicleOfUnit","_lockSwitch","_minWaitingTime", "_oldAnimation", "_captiveSwitch"]; + _args = _this select 0; + _unit = _args select 0; + _oldAnimation = _args select 1; + _captiveSwitch = _args select 2; + _originalPos = _args select 3; + _startingTime = _args select 4; + _minWaitingTime = _args select 5; - // Since the unit is no longer alive, get rid of this PFH. - if (!alive _unit) exitwith { - [format["%1 Unit no longer alive, exiting"], _unit] call FUNC(debug); - // EXIT PFH - [(_this select 1)] call cba_fnc_removePerFrameHandler; - [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); - }; + // Since the unit is no longer alive, get rid of this PFH. + if (!alive _unit) exitwith { + [format["%1 Unit no longer alive, exiting"], _unit] call FUNC(debug); + // EXIT PFH + [(_this select 1)] call cba_fnc_removePerFrameHandler; + [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); + }; - // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation - if !([_unit] call FUNC(isUnconscious)) exitwith { - [format["%1 Unit no longer unconscious, handling exit and animation"], _unit] call FUNC(debug); - // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations - if !([_unit] call FUNC(beingCarried)) then { - if (vehicle _unit == _unit) then { - [_unit,"amovppnemstpsnonwnondnon", 1] call FUNC(doAnimation); - } else { - // Switch to the units original animation, assuming - // TODO: what if the unit switched vehicle? - [_unit, _oldAnimation, 1] call FUNC(doAnimation); - }; + // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation + if !([_unit] call FUNC(isUnconscious)) exitwith { + [format["%1 Unit no longer unconscious, handling exit and animation"], _unit] call FUNC(debug); + // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations + if !([_unit] call FUNC(beingCarried)) then { + if (vehicle _unit == _unit) then { + [_unit,"amovppnemstpsnonwnondnon", 1] call FUNC(doAnimation); + } else { + // Switch to the units original animation, assuming + // TODO: what if the unit switched vehicle? + [_unit, _oldAnimation, 1] call FUNC(doAnimation); + }; - // EXIT PFH - [(_this select 1)] call cba_fnc_removePerFrameHandler; - [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); - }; - }; - // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs - if ((time - _startingTime) >= _minWaitingTime) exitwith { + // EXIT PFH + [(_this select 1)] call cba_fnc_removePerFrameHandler; + [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); + }; + }; + // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs + if ((time - _startingTime) >= _minWaitingTime) exitwith { - // Wait until the unit is no longer unconscious - if (!([_unit] call FUNC(getUnconsciousCondition))) then { - [format["%1 No unconscious condition valid anymore, moving uit out of unconsciousState"], _unit] call FUNC(debug); - // Reset the unit back to the previous captive state. - if (_captiveSwitch) then { - [_unit, false] call FUNC(setCaptiveSwitch); - }; - _unit setUnconscious false; + // Wait until the unit is no longer unconscious + if (!([_unit] call FUNC(getUnconsciousCondition))) then { + [format["%1 No unconscious condition valid anymore, moving uit out of unconsciousState"], _unit] call FUNC(debug); + // Reset the unit back to the previous captive state. + if (_captiveSwitch) then { + [_unit, false] call FUNC(setCaptiveSwitch); + }; + _unit setUnconscious false; - // Swhich the unit back to its original group - [_unit, false, "ACE_isUnconscious", side group _unit] call FUNC(switchToGroupSide_f); + // Swhich the unit back to its original group + [_unit, false, "ACE_isUnconscious", side group _unit] call FUNC(switchToGroupSide_f); - // Reset any visual and audio effects for players, or enable everything again for AI. - if (isPlayer _unit) then { - [false] call EFUNC(GUI,effectBlackOut); - [true] call FUNC(setVolume_f); - ["unconscious", false] call FUNC(setDisableUserInputStatus); - } else { - [_unit, false] call FUNC(disableAI_F); - _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) - }; + // Reset any visual and audio effects for players, or enable everything again for AI. + if (isPlayer _unit) then { + [false] call EFUNC(GUI,effectBlackOut); + [true] call FUNC(setVolume_f); + ["unconscious", false] call FUNC(setDisableUserInputStatus); + } else { + [_unit, false] call FUNC(disableAI_F); + _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) + }; - // Move unit out of unconscious state - _unit setvariable ["ACE_isUnconscious", false, true]; - [format["%1 Unit no longer unconsicous"], _unit] call FUNC(debug); - }; - }; + // Move unit out of unconscious state + _unit setvariable ["ACE_isUnconscious", false, true]; + [format["%1 Unit no longer unconsicous"], _unit] call FUNC(debug); + }; + }; - // A check to ensure that the animation is being played properly. - // TODO: Might no longer be necessary: Have to test this in MP. - if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call FUNC(getCarriedBy)))} && (time - _startingTime >= 0.5)) then { - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); // Reset animations if unit starts doing wierd things. - [format["%1 Had to reset an animation for unconscious"], _unit] call FUNC(debug); - }; + // A check to ensure that the animation is being played properly. + // TODO: Might no longer be necessary: Have to test this in MP. + if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call FUNC(getCarriedBy)))} && (time - _startingTime >= 0.5)) then { + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); // Reset animations if unit starts doing wierd things. + [format["%1 Had to reset an animation for unconscious"], _unit] call FUNC(debug); + }; }, 0.1, [_unit,_animState, _captiveSwitch, _originalPos, _startingTime, _minWaitingTime] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_setVolume_f.sqf b/addons/common/functions/fnc_setVolume_f.sqf index d9dccfa743..2eacb98ab0 100644 --- a/addons/common/functions/fnc_setVolume_f.sqf +++ b/addons/common/functions/fnc_setVolume_f.sqf @@ -12,36 +12,36 @@ #define MUTED_LEVEL 0.2 #define NORMAL_LEVEL 1 -#define NO_SOUND 0 +#define NO_SOUND 0 private ["_setVolume"]; _setVolume = [_this, 0, false, [false]] call BIS_fnc_Param; if (_setVolume) then { - // Vanilla Game - 2 fadeSound NORMAL_LEVEL; + // Vanilla Game + 2 fadeSound NORMAL_LEVEL; - // TFAR - player setVariable ["tf_voiceVolume", NORMAL_LEVEL, true]; - player setVariable ["tf_globalVolume", NORMAL_LEVEL]; - player setVariable ["tf_unable_to_use_radio", false]; + // TFAR + player setVariable ["tf_voiceVolume", NORMAL_LEVEL, true]; + player setVariable ["tf_globalVolume", NORMAL_LEVEL]; + player setVariable ["tf_unable_to_use_radio", false]; - // ACRE2 - player setVariable ["acre_sys_core_globalVolume", NORMAL_LEVEL]; - player setVariable ["acre_sys_core_isDisabled", false, true]; + // ACRE2 + player setVariable ["acre_sys_core_globalVolume", NORMAL_LEVEL]; + player setVariable ["acre_sys_core_isDisabled", false, true]; } else { - // Vanilla Game - 2 fadeSound MUTED_LEVEL; + // Vanilla Game + 2 fadeSound MUTED_LEVEL; - // TFAR - player setVariable ["tf_voiceVolume", NO_SOUND, true]; - player setVariable ["tf_globalVolume", MUTED_LEVEL]; - player setVariable ["tf_unable_to_use_radio", true]; + // TFAR + player setVariable ["tf_voiceVolume", NO_SOUND, true]; + player setVariable ["tf_globalVolume", MUTED_LEVEL]; + player setVariable ["tf_unable_to_use_radio", true]; - // ACRE2 - player setVariable ["acre_sys_core_globalVolume", MUTED_LEVEL]; - player setVariable ["acre_sys_core_isDisabled", true, true]; + // ACRE2 + player setVariable ["acre_sys_core_globalVolume", MUTED_LEVEL]; + player setVariable ["acre_sys_core_isDisabled", true, true]; }; diff --git a/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf b/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf index 3c0361aa70..bdd4fde460 100644 --- a/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf +++ b/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf @@ -14,25 +14,25 @@ private ["_unit"]; _unit = _this select 0; if ((vehicle _unit) isKindOf "StaticWeapon") then { - moveOut _unit; - unassignVehicle _unit; - //unassignVehicle _unit; - //_unit action ["eject", vehicle _unit]; + moveOut _unit; + unassignVehicle _unit; + //unassignVehicle _unit; + //_unit action ["eject", vehicle _unit]; }; if (vehicle _unit == _unit) then { - if (currentWeapon _unit == secondaryWeapon _unit) then { - reload _unit; - }; + if (currentWeapon _unit == secondaryWeapon _unit) then { + reload _unit; + }; }; if (animationState _unit in ["ladderriflestatic","laddercivilstatic"]) then { - _unit action ["ladderOff", (nearestBuilding _unit)]; + _unit action ["ladderOff", (nearestBuilding _unit)]; }; if (vehicle _unit == _unit) then { - if (currentWeapon _unit == secondaryWeapon _unit) then { - _unit selectWeapon (primaryWeapon _unit); - _unit switchMove ""; - _unit playmoveNow ""; - }; + if (currentWeapon _unit == secondaryWeapon _unit) then { + _unit selectWeapon (primaryWeapon _unit); + _unit switchMove ""; + _unit playmoveNow ""; + }; }; diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index a4e6814259..1d2a2af1bf 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -18,27 +18,27 @@ _indexes = []; _elements = []; { - _theElement = toArray (_x select _elementN); - _indexes pushback _foreachIndex; - _elements pushback _theElement; + _theElement = toArray (_x select _elementN); + _indexes pushback _foreachIndex; + _elements pushback _theElement; }foreach _array; for "_i" from 1 to (count _elements) - 1 do { - _tmp = _elements select _i; - _tempIndex = _indexes select _i; - _j = _i; - while {_j >= 1 && {_tmp < _elements select (_j - 1)}} do { - _elements set [_j, _elements select (_j - 1)]; - _indexes set [_j, _indexes select (_j - 1)]; - _j = _j - 1; - }; - _elements set[_j, _tmp]; - _indexes set [_j, _tempIndex]; + _tmp = _elements select _i; + _tempIndex = _indexes select _i; + _j = _i; + while {_j >= 1 && {_tmp < _elements select (_j - 1)}} do { + _elements set [_j, _elements select (_j - 1)]; + _indexes set [_j, _indexes select (_j - 1)]; + _j = _j - 1; + }; + _elements set[_j, _tmp]; + _indexes set [_j, _tempIndex]; }; _returnArray = []; { - _returnArray pushback (_array select _x); + _returnArray pushback (_array select _x); }foreach _indexes; _returnArray; \ No newline at end of file diff --git a/addons/common/functions/fnc_stringCompare.sqf b/addons/common/functions/fnc_stringCompare.sqf index 6331670ebc..2162f71fd0 100644 --- a/addons/common/functions/fnc_stringCompare.sqf +++ b/addons/common/functions/fnc_stringCompare.sqf @@ -26,8 +26,8 @@ _targetIterator = 0; _searchIterator = 0; while {(_searchIterator < _sizeSearchTerm) && (_targetIterator < _sizeString)} do { // Prevents us from going out of bounds if ((_arraySearchTerm select _searchIterator) == (_arrayString select _targetIterator)) then { // If we have a match, start looking for the next character in the search term - _matchingCharacters = _matchingCharacters + 1; - _searchIterator = _searchIterator + 1 + _matchingCharacters = _matchingCharacters + 1; + _searchIterator = _searchIterator + 1 }; _targetIterator = _targetIterator + 1; // Look at the next character in the string }; diff --git a/addons/common/functions/fnc_switchToGroupSide_f.sqf b/addons/common/functions/fnc_switchToGroupSide_f.sqf index b546859095..b13da8e3ea 100644 --- a/addons/common/functions/fnc_switchToGroupSide_f.sqf +++ b/addons/common/functions/fnc_switchToGroupSide_f.sqf @@ -18,49 +18,49 @@ _side = [_this, 3, side _unit,[west]] call BIS_fnc_Param; _previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo_F),[]]; if (_switch) then { - // go forward - _previousGroup = group _unit; - _originalSide = side group _unit; + // go forward + _previousGroup = group _unit; + _originalSide = side group _unit; - if (count units _previousGroup == 1 && _originalSide == _side) exitwith { - [format["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); - }; + if (count units _previousGroup == 1 && _originalSide == _side) exitwith { + [format["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); + }; - _newGroup = createGroup _side; - [_unit] joinSilent _newGroup; + _newGroup = createGroup _side; + [_unit] joinSilent _newGroup; - _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; - _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; + _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; + _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; } else { - // go one back - { - if (_id == (_x select 2)) exitwith { - _x set [ 3, false]; - _previousGroupsList set [_foreachIndex, _x]; - [format["found group with ID: %1", _id]] call FUNC(debug); - }; - }foreach _previousGroupsList; - reverse _previousGroupsList; + // go one back + { + if (_id == (_x select 2)) exitwith { + _x set [ 3, false]; + _previousGroupsList set [_foreachIndex, _x]; + [format["found group with ID: %1", _id]] call FUNC(debug); + }; + }foreach _previousGroupsList; + reverse _previousGroupsList; - { - if (_x select 3) exitwith {}; // stop at first id set to true - if !(_x select 3) then { - _currentGroup = group _unit; - if (!isNull (_x select 0)) then { - [_unit] joinSilent (_x select 0); - } else { - _newGroup = createGroup (_x select 1); - [_unit] joinSilent _newGroup; - }; - if (count units _currentGroup == 0) then { - deleteGroup _currentGroup; - }; - _previousGroupsList set [_foreachIndex, ObjNull]; - }; - }foreach _previousGroupsList; - _previousGroupsList = _previousGroupsList - [objNull]; - reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. - _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; + { + if (_x select 3) exitwith {}; // stop at first id set to true + if !(_x select 3) then { + _currentGroup = group _unit; + if (!isNull (_x select 0)) then { + [_unit] joinSilent (_x select 0); + } else { + _newGroup = createGroup (_x select 1); + [_unit] joinSilent _newGroup; + }; + if (count units _currentGroup == 0) then { + deleteGroup _currentGroup; + }; + _previousGroupsList set [_foreachIndex, ObjNull]; + }; + }foreach _previousGroupsList; + _previousGroupsList = _previousGroupsList - [objNull]; + reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. + _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; }; [[_unit, _switch, _id, _side],"switchToGroupSide"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index 60f3fdd93a..21d42072da 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -15,10 +15,10 @@ _array = _this select 0; _result = []; { - _value = _x; - if ({_x isEqualTo _value} count _result == 0) then { - _result pushback _x; - }; + _value = _x; + if ({_x isEqualTo _value} count _result == 0) then { + _result pushback _x; + }; }foreach _array; _result; \ No newline at end of file diff --git a/addons/common/functions/fnc_unloadPerson_f.sqf b/addons/common/functions/fnc_unloadPerson_f.sqf index 2cc89fabc6..1aaaee84a1 100644 --- a/addons/common/functions/fnc_unloadPerson_f.sqf +++ b/addons/common/functions/fnc_unloadPerson_f.sqf @@ -24,7 +24,7 @@ if (!([_caller] call FUNC(isAwake))) exitwith{false;}; moveOut _unit; unassignVehicle _unit; if (!alive _unit) then { - _unit action ["Eject", vehicle _unit]; + _unit action ["Eject", vehicle _unit]; }; [_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); @@ -34,26 +34,26 @@ _loaded = _loaded - [_unit]; _vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; if (!([_unit] call FUNC(isAwake))) then { - _handle = [_unit,_vehicle] spawn { - private ["_unit","_vehicle"]; - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit != _vehicle}; - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); - [format["Unit should move into death anim: %1", _unit]] call FUNC(debug); - }; + _handle = [_unit,_vehicle] spawn { + private ["_unit","_vehicle"]; + _unit = _this select 0; + _vehicle = _this select 1; + waituntil {vehicle _unit != _vehicle}; + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); + [format["Unit should move into death anim: %1", _unit]] call FUNC(debug); + }; } else { - if ([_unit] call FUNC(isArrested)) then { - _handle = [_unit,_vehicle] spawn { - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit != _vehicle}; - [_unit,"UnaErcPoslechVelitele2", 1] call FUNC(doAnimation); - [format["Unit should move into arrested anim: %1", _unit]] call FUNC(debug); - }; - } else { - [format["Unit should move into normal anim: %1", _unit]] call FUNC(debug); - }; + if ([_unit] call FUNC(isArrested)) then { + _handle = [_unit,_vehicle] spawn { + _unit = _this select 0; + _vehicle = _this select 1; + waituntil {vehicle _unit != _vehicle}; + [_unit,"UnaErcPoslechVelitele2", 1] call FUNC(doAnimation); + [format["Unit should move into arrested anim: %1", _unit]] call FUNC(debug); + }; + } else { + [format["Unit should move into normal anim: %1", _unit]] call FUNC(debug); + }; }; true; \ No newline at end of file diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index 0ef8f4783d..d03ec4d156 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -17,18 +17,18 @@ _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; _return = false; if (!_vehicleUsage) then { - if (_item != "") then { - if (_item in (items _unit)) then { - _unit removeItem _item; - _return = true; - } else { - if (_item in (assignedItems _unit)) then { - _unit unassignItem _item; - _unit removeItem _item; - _return = true; - }; - }; - }; + if (_item != "") then { + if (_item in (items _unit)) then { + _unit removeItem _item; + _return = true; + } else { + if (_item in (assignedItems _unit)) then { + _unit unassignItem _item; + _unit removeItem _item; + _return = true; + }; + }; + }; }; // TODO implement shared item functionality for with vehicles. diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index ef0d98deb7..726e169383 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -16,15 +16,15 @@ _magazine = _this select 1; _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; if (!_vehicleUsage) then { - if (_magazine != "") then { - _unit removeMagazine _magazine; - _return = true; - } else { - _return = false; - }; - [format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug); + if (_magazine != "") then { + _unit removeMagazine _magazine; + _return = true; + } else { + _return = false; + }; + [format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug); _return } else { - // TODO implement shared magazine functionality + // TODO implement shared magazine functionality }; \ No newline at end of file