diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 804a0ade78..587dc379a5 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -2,18 +2,17 @@ // internal handler for net events #include "script_component.hpp" -private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"]; +private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"]; -_eventType = _this select 0; -_event = _this select 1; +PARAMS_2(_eventType,_event); -if(_eventType == "ACEg") then { +if (_eventType == "ACEg") then { _eventName = _event select 0; _eventArgs = _event select 1; _eventNames = GVAR(events) select 0; _eventIndex = _eventNames find _eventName; - if(_eventIndex != -1) then { + if (_eventIndex != -1) then { _events = (GVAR(events) select 1) select _eventIndex; #ifdef DEBUG_EVENTS @@ -22,7 +21,7 @@ if(_eventType == "ACEg") then { #endif { - if(!isNil "_x") then { + if (!isNil "_x") then { _eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]); #ifdef DEBUG_EVENTS_CALLSTACK diag_log text format[ARR_2(" ID: %1",_forEachIndex)]; @@ -32,14 +31,14 @@ if(_eventType == "ACEg") then { }; }; -if(_eventType == "ACEc") then { - if(isServer) then { +if (_eventType == "ACEc") then { + if (isServer) then { _eventName = _event select 0; _eventTargets = _event select 1; _eventArgs = _event select 2; _sentEvents = []; - if(!IS_ARRAY(_eventTargets)) then { + if (!IS_ARRAY(_eventTargets)) then { _eventTargets = [_eventTargets]; }; @@ -52,14 +51,14 @@ if(_eventType == "ACEc") then { _serverFlagged = false; { _owner = _x; - if(IS_OBJECT(_x)) then { + if (IS_OBJECT(_x)) then { _owner = owner _x; }; - if(!(_owner in _sentEvents)) then { + if (!(_owner in _sentEvents)) then { PUSH(_sentEvents, _owner); ACEg = [_eventName, _eventArgs]; - if(isDedicated || {_x != ACE_player}) then { - if(isDedicated && {local _x} && {!_serverFlagged}) then { + if (isDedicated || {_x != ACE_player}) then { + if (isDedicated && {local _x} && {!_serverFlagged}) then { _serverFlagged = true; ["ACEg", ACEg] call FUNC(_handleNetEvent); } else { diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index 249ee7e1cd..c307783455 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -18,33 +18,26 @@ */ #include "script_component.hpp" -private ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", "_priority", "_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; +private ["_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; -_unit = _this select 0; -_displayName = _this select 1; -_action = _this select 2; -_condition = _this select 3; -_statement = _this select 4; -_condition2 = _this select 5; -_statement2 = _this select 6; -_priority = _this select 7; +PARAMS_8(_unit,_displayName,_action,_condition,_statement,_condition2,_statement2,_priority); if (isNil "_priority") then {_priority = 0}; if (typeName _condition == "STRING") then { - _condition = compile _condition; + _condition = compile _condition; }; if (typeName _statement == "STRING") then { - _statement = compile _statement; + _statement = compile _statement; }; if (typeName _condition2 == "STRING") then { - _condition2 = compile _condition2; + _condition2 = compile _condition2; }; if (typeName _statement2 == "STRING") then { - _statement2 = compile _statement2; + _statement2 = compile _statement2; }; _name = format ["ACE_ActionMenu_%1", _action]; @@ -61,20 +54,20 @@ missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _s _actionIDs pushBack _id; _addAction = call compile format [ - "[ - '%2', - {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, - nil, - %4, - false, - true, - '%1', - ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" - ]", - _action, - _displayName, - _nameVar, - _priority + "[ + '%2', + {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, + nil, + %4, + false, + true, + '%1', + ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" + ]", + _action, + _displayName, + _nameVar, + _priority ]; _actionID = _unit addAction _addAction; diff --git a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf index 0d1606aaf6..4623bb4ddb 100644 --- a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf +++ b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf @@ -7,7 +7,7 @@ disableSerialization; _dlg = ctrlParent _this; _dlg displayAddEventHandler ["unload", { - if (_this select 1 == 1) then { - [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); - }; + if (_this select 1 == 1) then { + [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); + }; }]; diff --git a/addons/common/functions/fnc_addEventHandler.sqf b/addons/common/functions/fnc_addEventHandler.sqf index 8524a4abef..86e034a0d9 100644 --- a/addons/common/functions/fnc_addEventHandler.sqf +++ b/addons/common/functions/fnc_addEventHandler.sqf @@ -11,14 +11,15 @@ * Event handler ID number (for use with fnc_removeEventHandler) */ #include "script_component.hpp" -private ["_eventName", "_eventCode", "_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"]; -_eventName = _this select 0; -_eventCode = _this select 1; + +private ["_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"]; + +PARAMS_2(_eventName,_eventCode); _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { +if (_eventIndex != -1) then { _eventFunctions = (GVAR(events) select 1) select _eventIndex; } else { _eventNameCount = count _eventNames; @@ -27,6 +28,6 @@ if(_eventIndex != -1) then { }; _eventFunctionCount = count _eventFunctions; -_eventFunctions set[_eventFunctionCount, _eventCode]; +_eventFunctions set [_eventFunctionCount, _eventCode]; _eventFunctionCount; \ No newline at end of file diff --git a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf index 64ce3e9735..c3975be496 100644 --- a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf @@ -11,12 +11,12 @@ */ #include "script_component.hpp" -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; +private ["_actionsVar", "_id", "_actionIDs", "_actions"]; -_statement = _this select 0; +PARAMS_1(_statement); if (typeName _statement == "STRING") then { - _statement = compile _statement; + _statement = compile _statement; }; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; @@ -26,8 +26,8 @@ _actionIDs = _actionsVar select 1; _actions = _actionsVar select 2; if (_id == 0) then { - uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; - ("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"]; + uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; + ("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"]; }; _actionIDs pushBack _id; diff --git a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf index 98444a160d..9f63719649 100644 --- a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; +private ["_actionsVar", "_id", "_actionIDs", "_actions"]; -_statement = _this select 0; +PARAMS_1(_statement); if (typeName _statement == "STRING") then { _statement = compile _statement; diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index d3f97f8ae0..ac62f20b3a 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -20,7 +20,7 @@ */ #include "script_component.hpp" -EXPLODE_8_PVT(_this,_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); +PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); _settingData = [_name] call FUNC(getSettingData); diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 339055487b..b319a92bd4 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -19,7 +19,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_classname); +PARAMS_2(_unit,_classname); DEFAULT_PARAM(2,_container,""); DEFAULT_PARAM(3,_ammoCount,-1); diff --git a/addons/common/functions/fnc_applyForceWalkStatus.sqf b/addons/common/functions/fnc_applyForceWalkStatus.sqf index 0f8ffb58ea..2e1c36db4a 100644 --- a/addons/common/functions/fnc_applyForceWalkStatus.sqf +++ b/addons/common/functions/fnc_applyForceWalkStatus.sqf @@ -17,9 +17,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_forceWalkNumber"]; +private ["_forceWalkNumber"]; -_unit = _this select 0; +PARAMS_1(_unit); _forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; _unit forceWalk (_forceWalkNumber > 0); diff --git a/addons/common/functions/fnc_binarizeNumber.sqf b/addons/common/functions/fnc_binarizeNumber.sqf index 11334083f8..0bf968b7ee 100644 --- a/addons/common/functions/fnc_binarizeNumber.sqf +++ b/addons/common/functions/fnc_binarizeNumber.sqf @@ -23,16 +23,16 @@ _array = []; _array resize _minLength; for "_index" from 0 to (_minLength - 1) do { - _array set [_index, false]; + _array set [_index, false]; }; _index = 0; while {_number > 0} do { - _rest = _number mod 2; - _number = floor (_number / 2); + _rest = _number mod 2; + _number = floor (_number / 2); - _array set [_index, _rest == 1]; - _index = _index + 1; + _array set [_index, _rest == 1]; + _index = _index + 1; }; _array diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index 8f5e50289f..57714b63cd 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -10,11 +10,11 @@ #include "script_component.hpp" -private ["_id", "_show"]; -_id = _this select 0; +private ["_show"]; +PARAMS_1(_id); _show = if (count _this > 1) then {_this select 1} else {false}; -if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { +if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; }; if (typeName _show == typeName 0) then { diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index ac6687fd4f..f1a351d224 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration); +PARAMS_5(_params,_function,_namespace,_uid,_duration); if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then { _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]]; diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index f4337b6171..2c84f11b4d 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -19,12 +19,11 @@ #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -private ["_unit", "_vehicle", "_position", "_checkDistance", "_index"]; +private ["_position", "_checkDistance", "_index"]; _this resize 5; -_unit = _this select 0; -_vehicle = _this select 1; +PARAMS_2(_unit,_vehicle); _position = toLower (_this select 2); _checkDistance = _this select 3; _index = _this select 4; // optional, please don't use @@ -44,218 +43,217 @@ _radius = 0; _enemiesInVehicle = false; //Possible Side Restriction { - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; + if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; } forEach crew _vehicle; _return = false; switch (_position) do { - case "driver" : { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - - if (_vehicle isKindOf "Tank") then { - _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2]; - }; - - _return = CANGETINDRIVER; - }; - - case "pilot" : { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - - _return = CANGETINDRIVER; - }; - - case "gunner" : { - private "_turretConfig"; - _turret = [_vehicle] call FUNC(getTurretGunner); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "commander" : { - private "_turretConfig"; - _turret = [_vehicle] call FUNC(getTurretCommander); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "copilot" : { - private "_turretConfig"; - _turret = [_vehicle] call FUNC(getTurretCopilot); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "turret" : { - private ["_turrets", "_turretConfig"]; - _turrets = [_vehicle] call FUNC(getTurretsOther); - - if (_index != -1 && {_turret = _turrets select _index; - CANGETINTURRETINDEX - }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - } else { - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - }; - }; - }; - }; - - case "ffv" : { - private ["_turrets", "_turretConfig"]; - _turrets = [_vehicle] call FUNC(getTurretsFFV); - - if (_index != -1 && {_turret = _turrets select _index; - CANGETINTURRETINDEX - }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - } else { - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - }; - }; - }; - }; - - case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - } else { - - _index = _positions select 0; - if (!isNil "_index") then { + case "driver" : { _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + if (_vehicle isKindOf "Tank") then { + _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2]; }; - _return = true - }; + _return = CANGETINDRIVER; }; - }; - case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - } else { - - _index = _positions select 0; - if (!isNil "_index") then { + case "pilot" : { _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - }; + _return = CANGETINDRIVER; }; - }; - default {}; + case "gunner" : { + private "_turretConfig"; + _turret = [_vehicle] call FUNC(getTurretGunner); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "commander" : { + private "_turretConfig"; + _turret = [_vehicle] call FUNC(getTurretCommander); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "copilot" : { + private "_turretConfig"; + _turret = [_vehicle] call FUNC(getTurretCopilot); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "turret" : { + private ["_turrets", "_turretConfig"]; + _turrets = [_vehicle] call FUNC(getTurretsOther); + + if (_index != -1 && {_turret = _turrets select _index; + CANGETINTURRETINDEX + }) then { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + }; + }; + }; + }; + + case "ffv" : { + private ["_turrets", "_turretConfig"]; + _turrets = [_vehicle] call FUNC(getTurretsFFV); + + if (_index != -1 && {_turret = _turrets select _index; + CANGETINTURRETINDEX + }) then { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + }; + }; + }; + }; + + case "codriver" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + } else { + _index = _positions select 0; + if (!isNil "_index") then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + }; + }; + }; + + case "cargo" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + } else { + + _index = _positions select 0; + if (!isNil "_index") then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + }; + }; + }; + + default {}; }; private "_fnc_isInRange"; _fnc_isInRange = { - if (_radius == 0) exitWith {true}; + if (_radius == 0) exitWith {true}; - private ["_unitPosition", "_distance"]; - _unitPosition = getPos _unit; + private ["_unitPosition", "_distance"]; + _unitPosition = getPos _unit; - _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); + _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); - if (!isNil "_selectionPosition2") then { - _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); - }; + if (!isNil "_selectionPosition2") then { + _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); + }; - _distance < _radius + _distance < _radius }; // if you want into the cargo and you can't, then check ffv turrets aswell if (_position == "cargo") exitWith { - if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { - [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); - } + if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { + [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); + }; }; _return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange} diff --git a/addons/common/functions/fnc_canInteract.sqf b/addons/common/functions/fnc_canInteract.sqf index e7c2ba1441..bdf87b20b7 100644 --- a/addons/common/functions/fnc_canInteract.sqf +++ b/addons/common/functions/fnc_canInteract.sqf @@ -8,6 +8,9 @@ * @PublicAPI: true */ #include "script_component.hpp" -private ["_unit","_return"]; -_unit = _this select 0; + +private ["_return"]; + +PARAMS_1(_unit); + (((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested))) \ No newline at end of file diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 667aec38b3..1a6e766855 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -14,10 +14,10 @@ */ #include "script_component.hpp" -private ["_unit", "_target", "_exceptions"]; +private ["_exceptions"]; + +PARAMS_2(_unit,_target); -_unit = _this select 0; -_target = _this select 1; _exceptions = if (count _this > 2) then { _this select 2; } else { diff --git a/addons/common/functions/fnc_canUseWeapon.sqf b/addons/common/functions/fnc_canUseWeapon.sqf index cbb33f1905..ed478a4470 100644 --- a/addons/common/functions/fnc_canUseWeapon.sqf +++ b/addons/common/functions/fnc_canUseWeapon.sqf @@ -3,9 +3,9 @@ // returns true if the unit is on foot or in a ffv position -private ["_unit", "_config"]; +private ["_config"]; -_unit = _this select 0; +PARAMS_1(_unit); if (_unit == vehicle _unit) exitWith {true}; diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 2cb37650b8..849bf08c6e 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -14,11 +14,9 @@ */ #include "script_component.hpp" -private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; +private ["_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; -_projectile = _this select 0; -_adjustDir = _this select 1; -_adjustUp = _this select 2; +PARAMS_3(_projectile,_adjustDir,_adjustUp); _adjustSpeed = if (count _this > 3) then { _this select 3 diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 2b738e2f1a..cce3dccab0 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -16,13 +16,11 @@ */ #include "script_component.hpp" -private ["_mode", "_checkAll", "_whitelist", "_logic"]; +private ["_logic"]; _this resize 3; -_mode = _this select 0; -_checkAll = _this select 1; -_whitelist = _this select 2; +PARAMS_3(_mode,_checkAll,_whitelist); if (isNil "_checkAll") then { _checkAll = false; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index 73317ee876..f97b69e194 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -13,12 +13,8 @@ * */ #include "script_component.hpp" - -private ["_unit", "_target", "_lockTarget"]; - -_unit = _this select 0; -_target = _this select 1; -_lockTarget = _this select 2; + +PARAMS_3(_unit,_target,_lockTarget); if (isNil "_lockTarget") then {_lockTarget = false}; @@ -26,7 +22,7 @@ private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { - diag_log text "[ACE] ERROR: Claiming already owned object."; + diag_log text "[ACE] ERROR: Claiming already owned object."; }; // transfer this immediately diff --git a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf index bfb8e3f18c..f487fc5737 100644 --- a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf +++ b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf @@ -13,36 +13,35 @@ #include "script_component.hpp" _this spawn { - _target = _this select 0; - _ignoreDead = _this select 1; - if (isNil "_ignoreDead") then {_ignoreDead = false}; + PARAMS_2(_target,_ignoreDead); + if (isNil "_ignoreDead") then {_ignoreDead = false}; - _vehicleTarget = vehicle _target; - _vehiclePlayer = vehicle ACE_player; - _inVehicle = _target != _vehicleTarget; + _vehicleTarget = vehicle _target; + _vehiclePlayer = vehicle ACE_player; + _inVehicle = _target != _vehicleTarget; - _position = getPosASL _target; + _position = getPosASL _target; - _fnc_check = { - // either unit changed vehicles - if (_vehiclePlayer != vehicle ACE_player) exitWith {True}; - if (_vehicleTarget != vehicle _target) exitWith {True}; + _fnc_check = { + // either unit changed vehicles + if (_vehiclePlayer != vehicle ACE_player) exitWith {True}; + if (_vehicleTarget != vehicle _target) exitWith {True}; - // target died - if (!alive _target && {!_ignoreDead}) exitWith {True}; + // target died + if (!alive _target && {!_ignoreDead}) exitWith {True}; - // player fell unconscious - if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True}; + // player fell unconscious + if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True}; - // target moved (outside of vehicle) - (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) - }; - - waitUntil { - if (call _fnc_check) then { - closeDialog 0; - call EFUNC(interaction,hideMenu); + // target moved (outside of vehicle) + (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) + }; + + waitUntil { + if (call _fnc_check) then { + closeDialog 0; + call EFUNC(interaction,hideMenu); + }; + (isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open }; - (isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open - }; }; diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf index 440cacc5a3..1698182051 100644 --- a/addons/common/functions/fnc_codeToString.sqf +++ b/addons/common/functions/fnc_codeToString.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_function"; - -_function = _this select 0; +PARAMS_1(_function); if (typeName _function == "STRING") exitWith {_function}; diff --git a/addons/common/functions/fnc_convertKeyCode.sqf b/addons/common/functions/fnc_convertKeyCode.sqf index a8af25401c..498a3eb706 100644 --- a/addons/common/functions/fnc_convertKeyCode.sqf +++ b/addons/common/functions/fnc_convertKeyCode.sqf @@ -16,9 +16,7 @@ #define KEY_MODIFIERS [42, 54, 29, 157, 56, 184] -private "_key"; - -_key = _this select 0; +PARAMS_1(_key); if (_key in KEY_MODIFIERS) exitWith {_key}; diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index c87772eb8a..b430c288a0 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -12,8 +12,8 @@ #define DEFAULT_LOGGING_LEVEL -1 #define DEFAULT_TEXT_DISPLAY -1 -private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; -_msg = _this select 0; +private ["_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; +PARAMS_1(_msg); _level = if (count _this > 1) then {_this select 1} else { 2 }; if (typeName _level != "NUMBER") then { diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf index f36bd97014..262ae9c02d 100644 --- a/addons/common/functions/fnc_debugModule.sqf +++ b/addons/common/functions/fnc_debugModule.sqf @@ -7,9 +7,10 @@ * @Return: * @PublicAPI: false */ + #include "script_component.hpp" -private ["_entity"]; -_entity = _this select 0; + +PARAMS_1(_entity); GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]); GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]); diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 8796edc920..28ed5b2015 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -9,11 +9,10 @@ */ #include "script_component.hpp" -private ["_name","_value","_defaultGlobal","_catagory","_code","_persistent"]; -_name = _this select 0; -_value = _this select 1; -_defaultGlobal = _this select 2; -_catagory = _this select 3; +private ["_code","_persistent"]; + +PARAMS_4(_name,_value,_defaultGlobal,_catagory); + _code = 0; _persistent = false; diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 0b1275e9cf..6284ae4551 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -13,9 +13,9 @@ #include "script_component.hpp" -private ["_state", "_dlg"]; +private ["_dlg"]; -_state = _this select 0; +PARAMS_1(_state); if (_state) then { disableSerialization; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 15cda902d7..3058c881a2 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -42,11 +42,10 @@ // other constants #define DEFAULT_TIME 6 -private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"]; -_iconId = _this select 0; -_show = _this select 1; -_icon = _this select 2; -_color = _this select 3; +private ["_allControls", "_refresh", "_timeAlive", "_list"]; + +PARAMS_4(_iconId,_show,_icon,_color); + _timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME}; disableSerialization; @@ -93,7 +92,7 @@ if (_show) then { if (_x select 0 == _iconId) exitwith { _list set [_foreachIndex, [_iconId, _icon, _color, time]]; }; - }foreach _list; + } forEach _list; }; missionNamespace setvariable [QGVAR(displayIconList), _list]; call _refresh; @@ -112,7 +111,7 @@ if (_show) then { if (_x select 0 != _iconId) then { _newList pushback _x; }; - }foreach _list; + } forEach _list; missionNamespace setvariable [QGVAR(displayIconList), _newList]; call _refresh; diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf index 7121ef6813..ced1fbb4af 100644 --- a/addons/common/functions/fnc_displayText.sqf +++ b/addons/common/functions/fnc_displayText.sqf @@ -20,11 +20,9 @@ _this resize 4; -private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"]; -_text = _this select 0; -_sound = _this select 1; -_delay = _this select 2; -_priority = _this select 3; +private ["_lastHintTime", "_lastHintPriority", "_time"]; + +PARAMS_4(_text,_sound,_delay,_priority); if (isNil QGVAR(lastHint)) then { GVAR(lastHint) = [0, 0]; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf index fadf28b480..93d4d38df7 100644 --- a/addons/common/functions/fnc_displayTextPicture.sqf +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -15,9 +15,8 @@ #include "script_component.hpp" -private ["_text", "_image", "_imageColor", "_target"]; -_text = _this select 0; -_image = _this select 1; +private ["_imageColor", "_target"]; +PARAMS_2(_text,_image); _imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]}; _imageColor resize 3; _target = if (count _this > 3) then {_this select 3} else {ACE_player}; diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 9f683800a1..07d9ec9e35 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -16,23 +16,21 @@ */ #include "script_component.hpp" -private ["_unit", "_animation", "_priority", "_force"]; +private ["_force"]; -_unit = _this select 0; -_animation = _this select 1; -_priority = _this select 2; +PARAMS_3(_unit,_animation,_priority); _force = False; // no animation given if (isNil "_animation") exitWith { - diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent]; + diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent]; }; if (isNil "_priority") then { - _priority = 0; + _priority = 0; }; if (count _this > 3) then { - _force = _this select 3; + _force = _this select 3; }; // don't overwrite more important animations @@ -43,31 +41,31 @@ if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", f // switchMove "" no longer works in dev 1.37 if (_animation == "") then { - _animation = [_unit] call FUNC(getDefaultAnim); + _animation = [_unit] call FUNC(getDefaultAnim); }; switch (_priority) do { - case 0 : { - if (_unit == vehicle _unit) then { - [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); - } else { - // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. - [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); + case 0 : { + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; }; - }; - case 1 : { - if (_unit == vehicle _unit) then { - [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); - } else { - // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. - [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); + case 1 : { + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); + }; }; - }; - case 2 : { - // Execute on all machines. SwitchMove has local effects. - [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); - }; - default {}; + case 2 : { + // Execute on all machines. SwitchMove has local effects. + [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; + default {}; }; ["Anim", [_priority, _animation]] call FUNC(log); diff --git a/addons/common/functions/fnc_dropBackpack.sqf b/addons/common/functions/fnc_dropBackpack.sqf index a2fd38b7c3..05ee3ab750 100644 --- a/addons/common/functions/fnc_dropBackpack.sqf +++ b/addons/common/functions/fnc_dropBackpack.sqf @@ -12,17 +12,13 @@ */ #include "script_component.hpp" -private "_unit"; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_backpackObject","_holder"]; -private "_backpackObject"; _backpackObject = backpackContainer _unit; - _unit addBackpack "Bag_Base"; removeBackpack _unit; - -private "_holder"; _holder = objNull; { diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 8a95172ea7..8572aaf134 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -1,17 +1,20 @@ //fnc_dumpArray.sqf #include "script_component.hpp" -private ["_var", "_depth", "_pad", "_i", "_x"]; +private ["_pad", "_i", "_x"]; + +PARAMS_2(_var,_depth); -_var = _this select 0; -_depth = _this select 1; _pad = ""; + for "_i" from 0 to _depth do { _pad = _pad + toString [9]; }; + _depth = _depth + 1; -if(IS_ARRAY(_var)) then { - if((count _var) > 0) then { + +if (IS_ARRAY(_var)) then { + if ((count _var) > 0) then { diag_log text format["%1[", _pad]; { [_x, _depth] call FUNC(dumpArray); diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index acf81ff20a..532850d7bb 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -5,7 +5,7 @@ diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; -if(!isNil "ACE_PFH_COUNTER") then { +if (!isNil "ACE_PFH_COUNTER") then { { private["_pfh"]; _pfh = _x select 0; @@ -16,7 +16,7 @@ if(!isNil "ACE_PFH_COUNTER") then { diag_log text format["ACE COUNTER RESULTS"]; diag_log text format["-------------------------------------------"]; { - private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; + private ["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; _counterEntry = _x; _iter = 0; _total = 0; diff --git a/addons/common/functions/fnc_eraseCache.sqf b/addons/common/functions/fnc_eraseCache.sqf index 94592ad409..9521bb3630 100644 --- a/addons/common/functions/fnc_eraseCache.sqf +++ b/addons/common/functions/fnc_eraseCache.sqf @@ -13,6 +13,6 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_namespace,_uid); +PARAMS_2(_namespace,_uid); _namespace setVariable [_uid, nil]; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index 9665fed5bb..3929477e76 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -15,7 +15,6 @@ disableSerialization; endLoadingScreen; - // no message without player possible if (!hasInterface) exitWith {}; @@ -30,10 +29,9 @@ if (isNull (call BIS_fnc_displayMission)) exitWith { }, 1, _this] call CBA_fnc_addPerFrameHandler; }; -private ["_textHeader", "_textMessage", "_onOK", "_onCancel"]; +private ["_onOK", "_onCancel"]; -_textHeader = _this select 0; -_textMessage = _this select 1; +PARAMS_2(_textHeader,_textMessage); _onOK = ARR_SELECT(_this,2,{}); _onCancel = ARR_SELECT(_this,3,{}); diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf index a0f71f9d51..39fef16519 100644 --- a/addons/common/functions/fnc_execNextFrame.sqf +++ b/addons/common/functions/fnc_execNextFrame.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_func,_params); +PARAMS_2(_func,_params); [ { diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index 248d35636e..dd160b8bfd 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -36,9 +36,9 @@ _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []]; // find index to overwrite function with the same name, add to end otherwise _index = count _persistentFunctions; { - if (_x select 2 == _name) exitWith { - _index = _forEachIndex; - }; + if (_x select 2 == _name) exitWith { + _index = _forEachIndex; + }; } forEach _persistentFunctions; // set new value @@ -46,8 +46,8 @@ _persistentFunctions set [_index, [_arguments, _function, _name]]; // broadcast variable if (typeName _unit == "NAMESPACE") then { - ACE_PersistentFunctions = _persistentFunctions; - publicVariable "ACE_PersistentFunctions"; + ACE_PersistentFunctions = _persistentFunctions; + publicVariable "ACE_PersistentFunctions"; } else { - _unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true]; + _unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true]; }; diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 111dbbdc0c..1df17050e6 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -26,46 +26,46 @@ _function = call compile (_this select 1); _unit = _this select 2; if (isNil "_unit") then { - _unit = 2; + _unit = 2; }; ["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); if (typeName _unit == "SCALAR") exitWith { - switch (_unit) do { - case 0 : { - _arguments call _function; - }; - case 1 : { - if (isServer) then { - _arguments call _function; - } else { - publicVariableServer QGVAR(remoteFnc); - }; - }; - case 2 : { - _arguments call _function; + switch (_unit) do { + case 0 : { + _arguments call _function; + }; + case 1 : { + if (isServer) then { + _arguments call _function; + } else { + publicVariableServer QGVAR(remoteFnc); + }; + }; + case 2 : { + _arguments call _function; - GVAR(remoteFnc) set [2, 0]; - publicVariable QGVAR(remoteFnc); + GVAR(remoteFnc) set [2, 0]; + publicVariable QGVAR(remoteFnc); + }; + case 3 : { + if (isDedicated) then { + _arguments call _function; + } else { + if (!isServer) then {publicVariableServer QGVAR(remoteFnc)}; + }; + }; }; - case 3 : { - if (isDedicated) then { - _arguments call _function; - } else { - if (!isServer) then {publicVariableServer QGVAR(remoteFnc)}; - }; - }; - }; }; if (local _unit) then { - _arguments call _function; + _arguments call _function; } else { - if (isServer) then { - _id = owner _unit; - _id publicVariableClient QGVAR(remoteFnc); - } else { - publicVariableServer QGVAR(remoteFnc); - }; + if (isServer) then { + _id = owner _unit; + _id publicVariableClient QGVAR(remoteFnc); + } else { + publicVariableServer QGVAR(remoteFnc); + }; }; diff --git a/addons/common/functions/fnc_executePersistent.sqf b/addons/common/functions/fnc_executePersistent.sqf index 80f29f35ad..a11fbb07aa 100644 --- a/addons/common/functions/fnc_executePersistent.sqf +++ b/addons/common/functions/fnc_executePersistent.sqf @@ -1,16 +1,14 @@ // by commy2 #include "script_component.hpp" -private "_target"; - -_target = _this select 0; +PARAMS_1(_target); { - if (isNil "_x") then { - diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex]; - } else { - if (typeName _x == "ARRAY") then { - [_x select 0, _target] call (_x select 1); + if (isNil "_x") then { + diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex]; + } else { + if (typeName _x == "ARRAY") then { + [_x select 0, _target] call (_x select 1); + }; }; - }; } forEach (_target getVariable ["ACE_PersistentFunctions", []]); diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf index c298785c26..b148f20a33 100644 --- a/addons/common/functions/fnc_exportConfig.sqf +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -9,61 +9,59 @@ private "_fnc_logEntries"; _fnc_logEntries = { - private ["_c", "_d", "_p", "_t", "_e"]; + private ["_p", "_t", "_e"]; - _c = _this select 0; - _d = _this select 1; + PARAMS_2(_c,_d); - _p = inheritsFrom _c; + _p = inheritsFrom _c; - _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; - for "_a" from 1 to _d do { - _t = " " + _t; - }; - diag_log text _t; - - _e = []; - for "_i" from 0 to (count _c - 1) do { - private ["_e1, _e2"]; - _e1 = _c select _i; - - _e2 = switch (true) do { - case (isNumber _e1): {getNumber _e1}; - case (isText _e1): {getText _e1}; - case (isArray _e1): {getArray _e1}; - case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; - }; - - if (typeName _e2 != "BOOL") then { - if (typeName _e2 == "ARRAY") then { - _e2 = toArray str _e2; - { - if (_x == toArray "[" select 0) then { - _e2 set [_forEachIndex, toArray "{" select 0]; - }; - if (_x == toArray "]" select 0) then { - _e2 set [_forEachIndex, toArray "}" select 0]; - }; - } forEach _e2; - _e2 = toString _e2; - _t = format ["%1[] = %2;", configName _e1, _e2]; - } else { - _t = format ["%1 = %2;", configName _e1, str _e2]; - }; - for "_a" from 0 to _d do { + _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; + for "_a" from 1 to _d do { _t = " " + _t; - }; - diag_log text _t; }; - }; + diag_log text _t; - _t = "};"; - for "_a" from 1 to _d do { - _t = " " + _t; - }; - diag_log text _t; - diag_log text ""; + _e = []; + for "_i" from 0 to (count _c - 1) do { + private ["_e1, _e2"]; + _e1 = _c select _i; + _e2 = switch (true) do { + case (isNumber _e1): {getNumber _e1}; + case (isText _e1): {getText _e1}; + case (isArray _e1): {getArray _e1}; + case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; + }; + + if (typeName _e2 != "BOOL") then { + if (typeName _e2 == "ARRAY") then { + _e2 = toArray str _e2; + { + if (_x == toArray "[" select 0) then { + _e2 set [_forEachIndex, toArray "{" select 0]; + }; + if (_x == toArray "]" select 0) then { + _e2 set [_forEachIndex, toArray "}" select 0]; + }; + } forEach _e2; + _e2 = toString _e2; + _t = format ["%1[] = %2;", configName _e1, _e2]; + } else { + _t = format ["%1 = %2;", configName _e1, str _e2]; + }; + for "_a" from 0 to _d do { + _t = " " + _t; + }; + diag_log text _t; + }; + }; + + _t = "};"; + for "_a" from 1 to _d do { + _t = " " + _t; + }; + diag_log text _t; + diag_log text ""; }; [_this, 0] call _fnc_logEntries; diff --git a/addons/common/functions/fnc_filter.sqf b/addons/common/functions/fnc_filter.sqf index 23e28c5fc5..8d4146faa5 100644 --- a/addons/common/functions/fnc_filter.sqf +++ b/addons/common/functions/fnc_filter.sqf @@ -15,10 +15,9 @@ */ #include "script_component.hpp" -private ["_array", "_code", "_newArray", "_index"]; +private ["_newArray", "_index"]; -_array = _this select 0; -_code = _this select 1; +PARAMS_2(_array,_code); if (isNil "_array") exitWith { diag_log text format ["[ACE] ERROR: No array for function filter in %1", _fnc_scriptNameParent]; @@ -27,8 +26,8 @@ if (isNil "_array") exitWith { _newArray = []; for "_index" from 0 to (count _array - 1) do { - if ((_array select _index) call _code) then { - _newArray pushBack (_array select _index); - }; + if ((_array select _index) call _code) then { + _newArray pushBack (_array select _index); + }; }; _newArray diff --git a/addons/common/functions/fnc_fixCrateContent.sqf b/addons/common/functions/fnc_fixCrateContent.sqf index 3128f783d5..ad3ed8e528 100644 --- a/addons/common/functions/fnc_fixCrateContent.sqf +++ b/addons/common/functions/fnc_fixCrateContent.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_crate", "_weapons", "_items"]; +private ["_weapons", "_items"]; -_crate = _this select 0; +PARAMS_1(_crate); // get all weapons inside the crate _weapons = weaponCargo _crate; diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index 411fdd2eb3..f07477f11d 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -18,5 +18,5 @@ PARAMS_1(_unit); if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {(vehicle _unit) == _unit}) then { - [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); + [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); }; diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index 529c11c549..2163accae2 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -10,8 +10,8 @@ #include "script_component.hpp" -private ["_object", "_return", "_val", "_category"]; -_object = _this select 0; +private ["_return", "_val", "_category"]; +PARAMS_1(_object); _category = if (count _this > 1) then { _this select 1 } else { "" }; if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith { diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index 1b1d7e03fa..aa2289309e 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -22,7 +22,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_unit); +PARAMS_1(_unit); if (isNull _unit) exitWith {[ "", diff --git a/addons/common/functions/fnc_getCaptivityStatus.sqf b/addons/common/functions/fnc_getCaptivityStatus.sqf index dcd3d6b0ff..50aeeced3a 100644 --- a/addons/common/functions/fnc_getCaptivityStatus.sqf +++ b/addons/common/functions/fnc_getCaptivityStatus.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_unit", "_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; +private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; -_unit = _this select 0; +PARAMS_1(_unit); _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; @@ -21,9 +21,9 @@ _unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(bin _unitCaptivityReasons = []; { - if (_unitCaptivityStatus select _forEachIndex) then { - _unitCaptivityReasons pushBack _x; - }; + if (_unitCaptivityStatus select _forEachIndex) then { + _unitCaptivityReasons pushBack _x; + }; } forEach _captivityReasons; _unitCaptivityReasons diff --git a/addons/common/functions/fnc_getChildren.sqf b/addons/common/functions/fnc_getChildren.sqf index 057b14ff40..d28ba7cb70 100644 --- a/addons/common/functions/fnc_getChildren.sqf +++ b/addons/common/functions/fnc_getChildren.sqf @@ -1,10 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_name", "_cfgClass", "_classes"]; +private ["_classes"]; -_name = _this select 0; -_cfgClass = _this select 1; +PARAMS_2(_name,_cfgClass); _classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); _classes = [_classes, {configName _this}] call FUNC(map); diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf index 4003c2a51f..44f02cbeb1 100644 --- a/addons/common/functions/fnc_getConfigCommander.sqf +++ b/addons/common/functions/fnc_getConfigCommander.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_turret"]; +private ["_config", "_turret"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _turret = [_vehicle] call FUNC(getTurretCommander); diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf index 80bdfb2cfa..a28491bfff 100644 --- a/addons/common/functions/fnc_getConfigGunner.sqf +++ b/addons/common/functions/fnc_getConfigGunner.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_turret"]; +private ["_config", "_turret"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _turret = [_vehicle] call FUNC(getTurretGunner); diff --git a/addons/common/functions/fnc_getConfigType.sqf b/addons/common/functions/fnc_getConfigType.sqf index f3c21923ef..b2d601c121 100644 --- a/addons/common/functions/fnc_getConfigType.sqf +++ b/addons/common/functions/fnc_getConfigType.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_item"; - -_item = _this select 0; +PARAMS_1(_item); if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"}; diff --git a/addons/common/functions/fnc_getConfigTypeObject.sqf b/addons/common/functions/fnc_getConfigTypeObject.sqf index 35799da6b5..ef39ce22c7 100644 --- a/addons/common/functions/fnc_getConfigTypeObject.sqf +++ b/addons/common/functions/fnc_getConfigTypeObject.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_object"; - -_object = _this select 0; +PARAMS_1(_object); if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"}; diff --git a/addons/common/functions/fnc_getDefaultAnim.sqf b/addons/common/functions/fnc_getDefaultAnim.sqf index fd53668396..fbcca2712e 100644 --- a/addons/common/functions/fnc_getDefaultAnim.sqf +++ b/addons/common/functions/fnc_getDefaultAnim.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_anim", "_stance"]; +private ["_anim", "_stance"]; -_unit = _this select 0; +PARAMS_1(_unit); _anim = toLower (animationState _unit); // stance is broken for some animations. diff --git a/addons/common/functions/fnc_getDefinedVariableInfo.sqf b/addons/common/functions/fnc_getDefinedVariableInfo.sqf index d371af6769..03b50b0649 100644 --- a/addons/common/functions/fnc_getDefinedVariableInfo.sqf +++ b/addons/common/functions/fnc_getDefinedVariableInfo.sqf @@ -7,5 +7,6 @@ * @Return: * @PublicAPI: false */ + #include "script_component.hpp" +(missionNamespace getvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + (_this select 0),[]]) diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf index 3ffc20de2f..4b8ffa58a2 100644 --- a/addons/common/functions/fnc_getDisplayConfigName.sqf +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -6,10 +6,10 @@ private ["_configName", "_index"]; _configName = ""; for "_index" from 0 to (count configFile - 1) do { - _config = configFile select _index; - if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { - _configName = configName _config; - }; + _config = configFile select _index; + if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { + _configName = configName _config; + }; }; _configName diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf index cfa7e0532c..f304c1714c 100644 --- a/addons/common/functions/fnc_getDoorTurrets.sqf +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -11,21 +11,21 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_doorTurrets", "_config"]; +private ["_turrets", "_doorTurrets", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _doorTurrets = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = [_config, _x] call FUNC(getTurretConfigPath); - if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { - _doorTurrets pushBack _x; - }; + if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { + _doorTurrets pushBack _x; + }; } forEach _turrets; _doorTurrets diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index 4cd493ec2c..a78152c052 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -9,10 +9,9 @@ */ #include "script_component.hpp" -private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; -_source = _this select 0; -_destination = _this select 1; -_accuracy = _this select 2; +private ["_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; + +PARAMS_3(_source,_destination,_accuracy); _result = [false, [0, 0, 0]]; diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 1b645bcdb2..7ec439ee01 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -7,12 +7,11 @@ * @Return: [intersects BOOL, intersection PositionASL] * @PublicAPI: true */ - #include "script_component.hpp" +#include "script_component.hpp" -private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; -_source = _this select 0; -_destination = _this select 1; -_accuracy = _this select 2; +private ["_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; + +PARAMS_3(_source,_destination,_accuracy); _result = [false, [0, 0, 0]]; diff --git a/addons/common/functions/fnc_getForceWalkStatus.sqf b/addons/common/functions/fnc_getForceWalkStatus.sqf index 10a70546fb..dbab640d86 100644 --- a/addons/common/functions/fnc_getForceWalkStatus.sqf +++ b/addons/common/functions/fnc_getForceWalkStatus.sqf @@ -17,9 +17,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; +private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; -_unit = _this select 0; +PARAMS_1(_unit); _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; @@ -29,9 +29,9 @@ _unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC _unitForceWalkReasons = []; { - if (_unitForceWalkStatus select _forEachIndex) then { - _unitForceWalkReasons pushBack _x; - }; + if (_unitForceWalkStatus select _forEachIndex) then { + _unitForceWalkReasons pushBack _x; + }; } forEach _forceWalkReasons; _unitForceWalkReasons diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index e832214601..ce73019f70 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -31,7 +31,7 @@ _gunner = objNull; // ensure that at least the pilot is returned if there is no gunner if (isManualFire _vehicle && {isNull _gunner}) then { - _gunner = driver _vehicle; + _gunner = driver _vehicle; }; -_gunner +_gunner \ No newline at end of file diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 26b0b1b840..bb788e4216 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_hitpoints"]; +private ["_config", "_hitpoints"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index f0c9801382..6398fa5a9d 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_hitpoints", "_selections"]; +private ["_config", "_hitpoints", "_selections"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index 062cc6cae4..d80c387b5d 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -18,10 +18,10 @@ #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -private ["_unit", "_vehicle", "_position", "_index"]; +private ["_position", "_index"]; + +PARAMS_2(_unit,_vehicle); -_unit = _this select 0; -_vehicle = _this select 1; _position = toLower (_this select 2); _index = _this select 3; // optional, please don't use @@ -40,107 +40,55 @@ _isInside = vehicle _unit == _vehicle; _script = {}; _enemiesInVehicle = false; //Possible Side Restriction { - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; + if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; } forEach crew _vehicle; switch (_position) do { - case "driver" : { - if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "pilot" : { - if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - _position = "driver"; - }; - }; - - case "gunner" : { - _turret = [_vehicle] call FUNC(getTurretGunner); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "commander" : { - _turret = [_vehicle] call FUNC(getTurretCommander); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "copilot" : { - _turret = [_vehicle] call FUNC(getTurretCopilot); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - }; - }; - - case "turret" : { - private "_turrets"; - _turrets = [_vehicle] call FUNC(getTurretsOther); - - if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; - } else { - - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { + case "driver" : { + if (CANGETINDRIVER) then { _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} ] select _enemiesInVehicle; - - _position = "gunner"; }; - }; }; - }; - case "ffv" : { - private "_turrets"; - _turrets = [_vehicle] call FUNC(getTurretsFFV); + case "pilot" : { + if (CANGETINDRIVER) then { + _script = [ + {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + _position = "driver"; + }; + }; - if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + case "gunner" : { + _turret = [_vehicle] call FUNC(getTurretGunner); - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - } else { + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { + case "commander" : { + _turret = [_vehicle] call FUNC(getTurretCommander); + + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; + + case "copilot" : { + _turret = [_vehicle] call FUNC(getTurretCopilot); + + if (CANGETINTURRETINDEX) then { _script = [ {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} @@ -148,93 +96,141 @@ switch (_position) do { _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" }; - }; }; - }; - case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + case "turret" : { + private "_turrets"; + _turrets = [_vehicle] call FUNC(getTurretsOther); - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; + if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - if (_index != -1 && {_index in _positions}) then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _position = "gunner"; + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - _position = "cargo"; - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - }; + _position = "gunner"; + }; + }; + }; }; - }; - case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + case "ffv" : { + private "_turrets"; + _turrets = [_vehicle] call FUNC(getTurretsFFV); - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; + if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - if (_index != -1 && {_index in _positions}) then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - _position = "cargo"; - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - }; + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + }; + }; + }; }; - }; - default {}; + case "codriver" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + } else { + _index = _positions select 0; + if (!isNil "_index") then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + }; + }; + }; + + case "cargo" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + } else { + _index = _positions select 0; + if (!isNil "_index") then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + }; + }; + }; + + default {}; }; // this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any. private "_fnc_getInEH"; _fnc_getInEH = { - private "_config"; - // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? - _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; + private "_config"; + // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? + _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; - if (isClass _config) then { - //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats - if !(_isInside) then { - [_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn"); + if (isClass _config) then { + //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats + if !(_isInside) then { + [_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn"); + }; }; - }; }; // if you want into the cargo and you can't, then check ffv turrets aswell if (_position == "cargo") exitWith { - if (_script isEqualTo {}) then { - [_unit, _vehicle, "ffv"] call FUNC(getInPosition); - } else { - call _script; - }; + if (_script isEqualTo {}) then { + [_unit, _vehicle, "ffv"] call FUNC(getInPosition); + } else { + call _script; + }; }; call _script; diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index 20d581f526..174029cccb 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -14,9 +14,7 @@ */ #include "script_component.hpp" -private "_item"; - -_item = _this select 0; +PARAMS_1(_item); _cfgType = [_item] call FUNC(getConfigType); @@ -46,7 +44,7 @@ switch (true) do { case (_type == 2^4): {["magazine","handgun"]}; // handgun case (_type == 2^8): {["magazine","primary"]}; // rifle case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines - //case (_type < 2^11): {["magazine","unknown"]}; + //case (_type < 2^11): {["magazine","unknown"]}; case (_type == 101): {["item","muzzle"]}; case (_type == 201): {["item","optics"]}; diff --git a/addons/common/functions/fnc_getLightProperties.sqf b/addons/common/functions/fnc_getLightProperties.sqf index ee1884ac1b..456084c3f9 100644 --- a/addons/common/functions/fnc_getLightProperties.sqf +++ b/addons/common/functions/fnc_getLightProperties.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_vehicle", "_light"]; - -_vehicle = _this select 0; -_light = _this select 1; +PARAMS_2(_vehicle,_light); private "_config"; _config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf index d444654b5f..03c6753a76 100644 --- a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_weapon"; - -_weapon = _this select 0; +PARAMS_1(_weapon); private "_config"; _config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; diff --git a/addons/common/functions/fnc_getMarkerType.sqf b/addons/common/functions/fnc_getMarkerType.sqf index 0324bf0ede..bba8c15199 100644 --- a/addons/common/functions/fnc_getMarkerType.sqf +++ b/addons/common/functions/fnc_getMarkerType.sqf @@ -11,25 +11,28 @@ */ #include "script_component.hpp" -_group = _this select 0; +private ["_leader","_vehicle","_side"]; + +PARAMS_1(_group); + _leader = leader _group; _vehicle = vehicle _leader; _side = side _leader; if (_vehicle == _leader) exitWith { - if ( - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or - (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") - ) then { - ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) - } else { - ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) - }; + if ( + (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or + (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") + ) then { + ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + } else { + ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + }; }; if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attendant") == 1) exitWith { - ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if ( (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportRepair") > 0) or @@ -38,35 +41,35 @@ if ( (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_canRepair") > 0) or (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_fuelCapacityCargo") > 0) ) exitWith { - ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Plane") exitWith { - ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Air") exitWith { - ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "StaticMortar") exitWith { - ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner") == 1) exitWith { - ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Car") exitWith { - ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if ((_vehicle isKindOf "Tank") and (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportSoldier") > 0)) exitWith { - ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Tank") exitWith { - ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Ship") exitWith { - ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; // generic marker diff --git a/addons/common/functions/fnc_getName.sqf b/addons/common/functions/fnc_getName.sqf index 4d10ce052c..1da59534f0 100644 --- a/addons/common/functions/fnc_getName.sqf +++ b/addons/common/functions/fnc_getName.sqf @@ -12,25 +12,24 @@ */ #include "script_component.hpp" -private ["_unit", "_showEffective", "_name"]; +private ["_name"]; -_unit = _this select 0; -_showEffective = _this select 1; +PARAMS_2(_unit,_showEffective); if (isNil "_showEffective") then { - _showEffective = false; + _showEffective = false; }; _name = ""; if (_unit isKindOf "CAManBase") then { - _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; + _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; } else { - if (_showEffective) then { - _name = [effectiveCommander _unit] call FUNC(getName); - } else { - _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); - }; + if (_showEffective) then { + _name = [effectiveCommander _unit] call FUNC(getName); + } else { + _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); + }; }; _name diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index ec4e9b5755..6b1d72097c 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -10,9 +10,7 @@ #include "script_component.hpp" -private ["_unit","_magazine"]; -_unit = _this select 0; -_magazine = _this select 1; +PARAMS_2(_unit,_magazine); _return = 0; if (_unit isKindOf "CAManBase") then { @@ -20,7 +18,7 @@ if (_unit isKindOf "CAManBase") then { } else { { _return = _return + {_x == _magazine} count magazines _x; - }foreach (crew _unit); + } forEach (crew _unit); _return = _return + ({_x == _magazine} count getMagazineCargo _unit); }; diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf index 6d47943155..56806d55db 100644 --- a/addons/common/functions/fnc_getReflectorsWithSelections.sqf +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -13,9 +13,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_hitpoints", "_selections"]; +private ["_config", "_hitpoints", "_selections"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; @@ -24,8 +24,8 @@ _selections = []; // iterate through all parents while {isClass _config} do { - private "_class"; - _class = _config >> "Reflectors"; + private "_class"; + _class = _config >> "Reflectors"; for "_i" from 0 to (count _class - 1) do { private ["_entry", "_selection"]; diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf index a3733560da..40ed962a7a 100644 --- a/addons/common/functions/fnc_getSettingData.sqf +++ b/addons/common/functions/fnc_getSettingData.sqf @@ -20,7 +20,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_name); +PARAMS_1(_name); private ["_value"]; _value = []; diff --git a/addons/common/functions/fnc_getStringFromMissionSQM.sqf b/addons/common/functions/fnc_getStringFromMissionSQM.sqf index a19e3490aa..cfb7495467 100644 --- a/addons/common/functions/fnc_getStringFromMissionSQM.sqf +++ b/addons/common/functions/fnc_getStringFromMissionSQM.sqf @@ -19,26 +19,26 @@ if (missionName == "") exitWith {""}; _mission = toArray toLower loadFile "mission.sqm"; _mission resize 65536; { - if (_x < 33) then { - _mission set [_forEachIndex, -1]; - } + if (_x < 33) then { + _mission set [_forEachIndex, -1]; + } } forEach _mission; _mission = toString (_mission - [-1]); {_path set [_forEachIndex, toLower _x]} forEach _path; for "_a" from 0 to (count _path - 2) do { - _class = format ["class%1{", _path select _a]; + _class = format ["class%1{", _path select _a]; - _index = _mission find _class; + _index = _mission find _class; - _array = toArray _mission; - for "_b" from 0 to (_index + count toArray _class - 1) do { - _array set [_b, -1]; - }; - _array = _array - [-1]; + _array = toArray _mission; + for "_b" from 0 to (_index + count toArray _class - 1) do { + _array set [_b, -1]; + }; + _array = _array - [-1]; - _mission = toString _array; + _mission = toString _array; }; _entry = format ["%1=", _path select (count _path - 1)]; @@ -47,7 +47,7 @@ if (_index == -1) exitWith {""}; _array = toArray _mission; for "_b" from 0 to (_index + count toArray _entry - 1) do { - _array set [_b, -1]; + _array set [_b, -1]; }; _mission = toString (_array - [-1]); diff --git a/addons/common/functions/fnc_getTargetDistance.sqf b/addons/common/functions/fnc_getTargetDistance.sqf index 79ef273fad..ac3c444a73 100644 --- a/addons/common/functions/fnc_getTargetDistance.sqf +++ b/addons/common/functions/fnc_getTargetDistance.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_interval", "_maxDistance", "_minDistance", "_position", "_laser", "_line", "_distance", "_iteration"]; +private ["_position", "_laser", "_line", "_distance", "_iteration"]; -_interval = _this select 0; -_maxDistance = _this select 1; -_minDistance = _this select 2; +PARAMS_3(_interval,_maxDistance,_minDistance); _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; @@ -29,15 +27,15 @@ _distance = _maxDistance; _iteration = _distance; while { - _iteration > _interval / 2 + _iteration > _interval / 2 } do { - _iteration = _iteration / 2; + _iteration = _iteration / 2; - _laser = ATLToASL positionCameraToWorld [0, 0, _distance]; - _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; - _line set [1, _laser]; + _laser = ATLToASL positionCameraToWorld [0, 0, _distance]; + _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; + _line set [1, _laser]; - _distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration); + _distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration); }; _distance = _interval * round (_distance / _interval); diff --git a/addons/common/functions/fnc_getTargetObject.sqf b/addons/common/functions/fnc_getTargetObject.sqf index c00a0e2340..6e3db94763 100644 --- a/addons/common/functions/fnc_getTargetObject.sqf +++ b/addons/common/functions/fnc_getTargetObject.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_maxDistance", "_position", "_laser", "_intersects"]; +private ["_position", "_laser", "_intersects"]; -_maxDistance = _this select 0; +PARAMS_1(_maxDistance); _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf index e50c15f593..b0eb201bca 100644 --- a/addons/common/functions/fnc_getTurnedOnLights.sqf +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_vehicle"; - -_vehicle = _this select 0; +PARAMS_1(_vehicle); if (!isLightOn _vehicle) exitWith {[]}; diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf index b26060b221..99665d03e3 100644 --- a/addons/common/functions/fnc_getTurretCommander.sqf +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf index aab3433a4f..8c62b958b5 100644 --- a/addons/common/functions/fnc_getTurretConfigPath.sqf +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -12,28 +12,27 @@ */ #include "script_component.hpp" -private ["_config", "_turretIndex", "_index", "_offset", "_config2", "_foundClasses"]; +private ["_index", "_offset", "_config2", "_foundClasses"]; -_config = _this select 0; -_turretIndex = _this select 1; +PARAMS_2(_config,_turretIndex); for "_index" from 0 to (count _turretIndex - 1) do { - _config = _config >> "Turrets"; + _config = _config >> "Turrets"; - _offset = 0; - _config2 = _config select 0; + _offset = 0; + _config2 = _config select 0; - _foundClasses = 0; - for "_a" from 0 to (count _config - 1) do { - if (isClass _config2) then { - _foundClasses = _foundClasses + 1; - } else { - _offset = _offset + 1; + _foundClasses = 0; + for "_a" from 0 to (count _config - 1) do { + if (isClass _config2) then { + _foundClasses = _foundClasses + 1; + } else { + _offset = _offset + 1; + }; + _config2 = _config select (_turretIndex select _index) + _offset; + + if (_foundClasses == _turretIndex select _index) exitWith {}; }; - _config2 = _config select (_turretIndex select _index) + _offset; - - if (_foundClasses == _turretIndex select _index) exitWith {}; - }; - _config = _config2; + _config = _config2; }; _config diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf index 9f51f8724c..d496051558 100644 --- a/addons/common/functions/fnc_getTurretCopilot.sqf +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -11,20 +11,21 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { - _turret = _x; - }; + if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { + _turret = _x; + }; } forEach _turrets; + _turret diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index fb265bf545..79977e4d8c 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_vehicle,_position); +PARAMS_2(_vehicle,_position); private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"]; _turret = [_vehicle, _position] call CBA_fnc_getTurret; @@ -25,7 +25,7 @@ TRACE_3("", _pov, _gunBeg, _gunEnd); _povPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _pov ) ); _povDir = [0,0,0]; -if(_pov == "pip0_pos") then { +if (_pov == "pip0_pos") then { _pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) ); _povDir = _pipDir vectorDiff _povPos; } else { diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf index ba1802c37f..a4bcca54dd 100644 --- a/addons/common/functions/fnc_getTurretGunner.sqf +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -11,20 +11,21 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "primaryGunner") == 1) exitWith { - _turret = _x; - }; + if (getNumber (_config >> "primaryGunner") == 1) exitWith { + _turret = _x; + }; } forEach _turrets; + _turret diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index 85d69b6828..bfb96b4665 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_turrets", "_units", "_index"]; +private ["_vehicle", "_turrets", "_units", "_index"]; -_unit = _this select 0; +PARAMS_1(_unit); _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf index 47ffcde090..97d80312d3 100644 --- a/addons/common/functions/fnc_getTurrets.sqf +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_type", "_config", "_turrets", "_fnc_addTurret"]; +private ["_config", "_turrets", "_fnc_addTurret"]; -_type = _this select 0; +PARAMS_1(_type); _varName = format ["ACE_CachedTurrets_%1", _type]; _turrets = + (uiNamespace getVariable _varName); @@ -24,26 +24,25 @@ _config = configFile >> "CfgVehicles" >> _type; _turrets = []; _fnc_addTurret = { - private ["_config", "_path", "_count", "_offset", "_index", "_path2", "_config2"]; + private ["_count", "_offset", "_index", "_path2", "_config2"]; - _config = _this select 0; - _path = _this select 1; + PARAMS_2(_config,_path); - _config = _config >> "Turrets"; - _count = count _config; + _config = _config >> "Turrets"; + _count = count _config; - _offset = 0; - for "_index" from 0 to (_count - 1) do { - _path2 = _path + [_index - _offset]; - _config2 = _config select _index; + _offset = 0; + for "_index" from 0 to (_count - 1) do { + _path2 = _path + [_index - _offset]; + _config2 = _config select _index; - if (isClass _config2) then { - _turrets pushBack _path2; - [_config2, _path2] call _fnc_addTurret; - } else { - _offset = _offset + 1; + if (isClass _config2) then { + _turrets pushBack _path2; + [_config2, _path2] call _fnc_addTurret; + } else { + _offset = _offset + 1; + }; }; - }; }; [_config, []] call _fnc_addTurret; diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf index f915d6c096..2eaa8807b0 100644 --- a/addons/common/functions/fnc_getTurretsFFV.sqf +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -11,20 +11,20 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "isPersonTurret") == 1) then { - _turret pushBack _x; - }; + if (getNumber (_config >> "isPersonTurret") == 1) then { + _turret pushBack _x; + }; } forEach _turrets; _turret diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf index 102c1a9d1c..5f373f7c9c 100644 --- a/addons/common/functions/fnc_getTurretsOther.sqf +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -11,24 +11,24 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if ( getNumber (_config >> "isCopilot") != 1 - && {getNumber (_config >> "primaryGunner") != 1} - && {getNumber (_config >> "primaryObserver") != 1} - && {getNumber (_config >> "isPersonTurret") != 1} - ) then { - _turret pushBack _x; - }; + if ( getNumber (_config >> "isCopilot") != 1 + && {getNumber (_config >> "primaryGunner") != 1} + && {getNumber (_config >> "primaryObserver") != 1} + && {getNumber (_config >> "isPersonTurret") != 1} + ) then { + _turret pushBack _x; + }; } forEach _turrets; _turret diff --git a/addons/common/functions/fnc_getUavControlPosition.sqf b/addons/common/functions/fnc_getUavControlPosition.sqf index 82b04e2928..ad2487c9c1 100644 --- a/addons/common/functions/fnc_getUavControlPosition.sqf +++ b/addons/common/functions/fnc_getUavControlPosition.sqf @@ -20,9 +20,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_uav", "_positionArray", "_playerIndex"]; +private ["_uav", "_positionArray", "_playerIndex"]; -_unit = _this select 0; +PARAMS_1(_unit); _uav = getConnectedUAV _unit; if (isNull _uav) exitWith {""}; _positionArray = UAVControl _uav; diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf index e0483e8487..2988085d19 100644 --- a/addons/common/functions/fnc_getVehicleCargo.sqf +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_cargo", "_codrivers"]; +private ["_config", "_cargo", "_codrivers"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> _vehicle; @@ -21,8 +21,8 @@ _cargo = []; _codrivers = getArray (_config >> "cargoIsCoDriver"); for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { - if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _cargo pushBack _index; - }; + if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _cargo pushBack _index; + }; }; _cargo diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf index 4fd8058d1e..7951c01d13 100644 --- a/addons/common/functions/fnc_getVehicleCodriver.sqf +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_cargo", "_codrivers"]; +private ["_config", "_cargo", "_codrivers"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> _vehicle; @@ -21,8 +21,8 @@ _cargo = []; _codrivers = getArray (_config >> "cargoIsCoDriver"); for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { - if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _cargo pushBack _index; - }; + if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _cargo pushBack _index; + }; }; _cargo diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf index b14fbe561e..23957c31fd 100644 --- a/addons/common/functions/fnc_getVehicleCrew.sqf +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -12,10 +12,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_types", "_crew"]; +private ["_crew"]; -_vehicle = _this select 0; -_types = _this select 1; +PARAMS_2(_vehicle,_types); _crew = []; diff --git a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf index 7433991e29..03b7b1c707 100644 --- a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf @@ -12,9 +12,9 @@ */ #include "script_component.hpp" -private ["_weapon", "_direction", "_azimuth", "_inclination"]; +private ["_direction", "_azimuth", "_inclination"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _direction = ACE_player weaponDirection _weapon; diff --git a/addons/common/functions/fnc_getWeaponIndex.sqf b/addons/common/functions/fnc_getWeaponIndex.sqf index f2b8bce9f2..b11054a5e7 100644 --- a/addons/common/functions/fnc_getWeaponIndex.sqf +++ b/addons/common/functions/fnc_getWeaponIndex.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" - EXPLODE_2_PVT(_this,_unit,_weapon); +PARAMS_2(_unit,_weapon); if (_weapon == "") exitWith {-1}; diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index c5f04d1e5d..83e7b7559f 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_weapon", "_modes"]; +private ["_modes"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _modes = []; { diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index a3e308abfc..b0b7173d2f 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_weapon", "_muzzles"]; +private ["_muzzles"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 4ec54cc787..543f356b7e 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon"]; - -_unit = _this select 0; -_weapon = _this select 1; +PARAMS_2(_unit,_weapon); private "_muzzles"; _muzzles = [_weapon] call FUNC(getWeaponMuzzles); diff --git a/addons/common/functions/fnc_getWeaponType.sqf b/addons/common/functions/fnc_getWeaponType.sqf index 89ee46427b..c153bb2b3c 100644 --- a/addons/common/functions/fnc_getWeaponType.sqf +++ b/addons/common/functions/fnc_getWeaponType.sqf @@ -11,20 +11,21 @@ */ #include "script_component.hpp" -private ["_weapon", "_type", "_index"]; +private ["_type", "_index"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); _index = 0; + while {!(_type select _index) && {_index < 16}} do { - _index = _index + 1; + _index = _index + 1; }; switch (_index) do { - case 0 : {1}; - case 1 : {3}; - case 2 : {2}; - default {-1}; + case 0 : {1}; + case 1 : {3}; + case 2 : {2}; + default {-1}; } diff --git a/addons/common/functions/fnc_getWindDirection.sqf b/addons/common/functions/fnc_getWindDirection.sqf index 5bd4ff12ff..d93023bfe4 100644 --- a/addons/common/functions/fnc_getWindDirection.sqf +++ b/addons/common/functions/fnc_getWindDirection.sqf @@ -12,20 +12,20 @@ #include "script_component.hpp" switch (round (windDir / 360 * 16)) do { - case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; - case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; - case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; - case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; - case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; - case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; - case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; - case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; - case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; - case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; - case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; - case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; - case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; - case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; - case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; - default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; + case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; + case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; + case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; + case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; + case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; + case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; + case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; + case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; + case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; + case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; + case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; + case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; + case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; + case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; + case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; + default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; }; diff --git a/addons/common/functions/fnc_globalEvent.sqf b/addons/common/functions/fnc_globalEvent.sqf index dcf40261cf..af9d080ac9 100644 --- a/addons/common/functions/fnc_globalEvent.sqf +++ b/addons/common/functions/fnc_globalEvent.sqf @@ -11,11 +11,8 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventArgs"]; - -_eventName = _this select 0; -_eventArgs = _this select 1; +PARAMS_2(_eventName,_eventArgs); ACEg = [_eventName, _eventArgs]; publicVariable "ACEg"; diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index fbe7c3b8f3..614ea34ee9 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -11,22 +11,20 @@ */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); try { - if (_unit == vehicle _unit) then { - switch (currentWeapon _unit) do { - case "" : {throw "AmovPknlMstpSnonWnonDnon"}; - case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; - case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; - case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; - case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; + if (_unit == vehicle _unit) then { + switch (currentWeapon _unit) do { + case "" : {throw "AmovPknlMstpSnonWnonDnon"}; + case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; + case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; + case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; + case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; + }; }; - }; } catch { - if (stance _unit != "PRONE") then { - [_unit, _exception] call FUNC(doAnimation); - }; + if (stance _unit != "PRONE") then { + [_unit, _exception] call FUNC(doAnimation); + }; }; diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf index db52a48d80..5503643026 100644 --- a/addons/common/functions/fnc_hadamardProduct.sqf +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -13,8 +13,7 @@ */ #include "script_component.hpp" -_vector1 = _this select 0; -_vector2 = _this select 1; +PARAMS_2(_vector1,_vector2); _newVector = []; diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index 0157fab8e3..52a5ed4cd5 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -10,13 +10,13 @@ #include "script_component.hpp" -private ["_unit","_magazine","_return"]; -_unit = _this select 0; -_magazine = _this select 1; +private ["_return"]; +PARAMS_2(_unit,_magazine); if (_magazine != "") then { _return = (_magazine in magazines _unit); } else { _return = false; }; + _return \ No newline at end of file diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index 7682b2f6a2..ea2e104de5 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -1,11 +1,11 @@ //fnc_hashGet.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; +private ["_val", "_index"]; // diag_log text format["%1 HASH GET: %2", diag_tickTime, _this]; -_hash = _this select 0; -_key = _this select 1; +PARAMS_2(_hash,_key); + ERRORDATA(2); _val = nil; try { diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index 8011e987fb..83ddfe3877 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -1,11 +1,11 @@ //fnc_hashHasKey.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; +private ["_val", "_index"]; // diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this]; -_hash = _this select 0; -_key = _this select 1; +PARAMS_2(_hash,_key); + ERRORDATA(2); _val = false; try { diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf index cdad5987cd..c7a6085fea 100644 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ b/addons/common/functions/fnc_hashListCreateHash.sqf @@ -1,9 +1,10 @@ //fnc_hashListCreateHash.sqf #include "script_component.hpp" -private ["_hashList", "_hashKeys"]; +private ["_hashKeys"]; + +PARAMS_1(_hashList); -_hashList = _this select 0; ERRORDATA(1); _hashKeys = []; try { diff --git a/addons/common/functions/fnc_hashListCreateList.sqf b/addons/common/functions/fnc_hashListCreateList.sqf index 66061c1aa0..d24b22e7c3 100644 --- a/addons/common/functions/fnc_hashListCreateList.sqf +++ b/addons/common/functions/fnc_hashListCreateList.sqf @@ -1,7 +1,6 @@ //fnc_hashListCreateList.sqf #include "script_component.hpp" -private ["_keys"]; +PARAMS_1(_keys); -_keys = _this select 0; [_keys,[]]; diff --git a/addons/common/functions/fnc_hashListPush.sqf b/addons/common/functions/fnc_hashListPush.sqf index afd092a1b9..d8908dbe33 100644 --- a/addons/common/functions/fnc_hashListPush.sqf +++ b/addons/common/functions/fnc_hashListPush.sqf @@ -1,10 +1,8 @@ //fnc_hashListPush.sqf #include "script_component.hpp" -private ["_hashList", "_value"]; +PARAMS_2(_hashList,_value); -_hashList = _this select 0; -_value = _this select 1; ERRORDATA(2); try { if(VALIDHASH(_hashList)) then { diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index 0c552d072e..df91f3ac77 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -1,10 +1,9 @@ //fnc_hashListSelect.sqf #include "script_component.hpp" -private ["_hashList", "_index", "_hash", "_keys", "_hashes", "_values"]; +private ["_hash", "_keys", "_hashes", "_values"]; -_hashList = _this select 0; -_index = _this select 1; +PARAMS_2(_hashList,_index); ERRORDATA(2); _hash = nil; try { diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf index c384bc15c9..fdb19350df 100644 --- a/addons/common/functions/fnc_hashListSet.sqf +++ b/addons/common/functions/fnc_hashListSet.sqf @@ -1,11 +1,9 @@ //fnc_hashListSet.sqf #include "script_component.hpp" -private ["_hashList", "_index", "_value", "_vals"]; +private ["_vals"]; -_hashList = _this select 0; -_index = _this select 1; -_value = _this select 2; +PARAMS_3(_hashList,_index,_value); ERRORDATA(3); try { if(VALIDHASH(_hashList)) then { diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index 000dbbefe0..7f7bb17cc4 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -1,10 +1,9 @@ //fnc_hashRem.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; +private ["_val", "_index"]; -_hash = _this select 0; -_key = _this select 1; +PARAMS_2(_hash,_key); ERRORDATA(2); _val = nil; try { diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index 0e374d5f12..d6c9948e7a 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -1,12 +1,11 @@ //fnc_hashSet.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; +private ["_index"]; // diag_log text format["%1 HASH SET: %2", diag_tickTime, _this]; -_hash = _this select 0; -_key = _this select 1; -_val = _this select 2; +PARAMS_3(_hash,_key,_val); + ERRORDATA(3); try { if(VALIDHASH(_hash)) then { diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index 2fdede1737..f6f491535f 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -10,13 +10,16 @@ #include "script_component.hpp" -private ["_unit","_return","_aslPos"]; -_unit = _this select 0; +private ["_return","_aslPos"]; + +PARAMS_1(_unit); _return = false; + if ((surfaceIsWater getPos _unit)) then { _aslPos = _unit modelToWorldVisual (_unit selectionPosition "head"); if ((_aslPos select 2) <= 0) then { _return = true; }; }; -_return; \ No newline at end of file + +_return; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 6a39152b9b..27d84b9d12 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" - private ["_configEntry","_configMatch", "_match"]; -_configEntry = _this select 0; -_configMatch = _this select 1; + private ["_match"]; +PARAMS_2(_configEntry,_configMatch); if (configName _configEntry == _configMatch) exitWith { true }; if (configName _configEntry == ",") exitWith { false }; diff --git a/addons/common/functions/fnc_interpolateFromArray.sqf b/addons/common/functions/fnc_interpolateFromArray.sqf index 8c0c8daa36..2427fa47b5 100644 --- a/addons/common/functions/fnc_interpolateFromArray.sqf +++ b/addons/common/functions/fnc_interpolateFromArray.sqf @@ -1,10 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_array", "_value", "_min", "_max"]; +private ["_min", "_max"]; -_array = _this select 0; -_value = _this select 1; +PARAMS_2(_array,_value); _min = _array select floor _value; _max = _array select ceil _value; diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index 10136c0369..01c03bfc1f 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -10,6 +10,7 @@ #include "script_component.hpp" -private ["_unit","_return"]; -_unit = _this select 0; +private ["_return"]; +PARAMS_1(_unit); + (!(_unit getvariable ["ACE_isUnconscious",false]) && alive _unit && !(_unit getvariable ["ACE_isDead",false])); diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf index 6149dfa37b..11fbf45306 100644 --- a/addons/common/functions/fnc_isEOD.sqf +++ b/addons/common/functions/fnc_isEOD.sqf @@ -20,8 +20,6 @@ */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); _unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index 2bdb62df4c..4cc5f42bc9 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -11,8 +11,6 @@ */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] diff --git a/addons/common/functions/fnc_isInBuilding.sqf b/addons/common/functions/fnc_isInBuilding.sqf index 0989db42da..adecf5ac0c 100644 --- a/addons/common/functions/fnc_isInBuilding.sqf +++ b/addons/common/functions/fnc_isInBuilding.sqf @@ -13,9 +13,9 @@ #define DISTANCE 10 -private ["_unit", "_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; +private ["_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; -_unit = _this select 0; +PARAMS_1(_unit); _position = eyePos _unit; _positionX = _position select 0; diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index 8f722ed733..35270ccfc4 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -11,23 +11,23 @@ */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; +private ["_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; -_unit = _this select 0; +PARAMS_1(_unit); _vehicle = vehicle _unit; _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _animation = animationState _unit; if (_unit == driver _vehicle) then { - _action = getText (_config >> "driverAction"); - _inAction = getText (_config >> "driverInAction"); + _action = getText (_config >> "driverAction"); + _inAction = getText (_config >> "driverInAction"); } else { - _turretIndex = [_unit] call FUNC(getTurretIndex); + _turretIndex = [_unit] call FUNC(getTurretIndex); - _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); + _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); - _action = getText (_config >> "gunnerAction"); - _inAction = getText (_config >> "gunnerInAction"); + _action = getText (_config >> "gunnerAction"); + _inAction = getText (_config >> "gunnerInAction"); }; if (_action == "" || {_inAction == ""} || {_action == _inAction}) exitWith {false}; diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index 785ebf8212..6722c3a554 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -12,15 +12,11 @@ */ #include "script_component.hpp" -private ["_unit", "_lightSource"]; +private ["_unitPos","_lightLevel"]; -_unit = _this select 0; -_lightSource = _this select 1; +PARAMS_2(_unit,_lightSource); -private "_unitPos"; _unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); - -private "_lightLevel"; _lightLevel = 0; if (_lightSource isKindOf "CAManBase") then { diff --git a/addons/common/functions/fnc_log.sqf b/addons/common/functions/fnc_log.sqf index 43a5a27682..21ae4cfbf8 100644 --- a/addons/common/functions/fnc_log.sqf +++ b/addons/common/functions/fnc_log.sqf @@ -2,29 +2,24 @@ #include "script_component.hpp" if ((_this select 0) in (missionNamespace getVariable ["ACE_Debug", []])) then { - private ["_type", "_argument", "_function", "_showInGame"]; + _this resize 4; - _this resize 4; + PARAMS_4(_type,_argument,_function,_showInGame); - _type = _this select 0; - _argument = _this select 1; - _function = _this select 2; - _showInGame = _this select 3; + if (isNil "_function") then { + _function = {_this}; + }; - if (isNil "_function") then { - _function = {_this}; - }; + if (isNil "_showInGame") then { + _showInGame = true; + }; - if (isNil "_showInGame") then { - _showInGame = true; - }; + private "_result"; + _result = _argument call _function; - private "_result"; - _result = _argument call _function; + if (_showInGame) then { + systemChat format ["%1", _result]; + }; - if (_showInGame) then { - systemChat format ["%1", _result]; - }; - - diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; + diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; }; diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index 99c52ae742..16ed168218 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -21,11 +21,11 @@ _array = + _this select 0; _code = _this select 1; if (isNil "_array") exitWith { - diag_log text format ["[ACE] ERROR: No array for function map in %1", _fnc_scriptNameParent]; - [] + diag_log text format ["[ACE] ERROR: No array for function map in %1", _fnc_scriptNameParent]; + [] }; { - _array set [_forEachIndex, _x call _code]; + _array set [_forEachIndex, _x call _code]; } forEach _array; _array diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf index 7137f1ea1d..e0fa562e8c 100644 --- a/addons/common/functions/fnc_moduleCheckPBOs.sqf +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index f06c1cf2ea..dec118231d 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -11,37 +11,35 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; { - _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); - if (_hiddenSelections > 0) then { - nul = [_x, _hiddenSelections] spawn { - _vehicle = _this select 0; - _hSCount = _this select 1; - _colors = [ - "#(argb,8,8,3)color(1,0,0,1,co)", - "#(argb,8,8,3)color(1,0.5,0,1,co)", - "#(argb,8,8,3)color(1,1,0,1,co)", - "#(argb,8,8,3)color(0,1,0,1,co)", - "#(argb,8,8,3)color(0,0,1,1,co)", - "#(argb,8,8,3)color(0.2,0,0.5,1,co)", - "#(argb,8,8,3)color(0.5,0,1,1,co)" - ]; - _index = 0; - while {True} do { - for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, (_colors select _index)]; + _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); + if (_hiddenSelections > 0) then { + nul = [_x, _hiddenSelections] spawn { + _vehicle = _this select 0; + _hSCount = _this select 1; + _colors = [ + "#(argb,8,8,3)color(1,0,0,1,co)", + "#(argb,8,8,3)color(1,0.5,0,1,co)", + "#(argb,8,8,3)color(1,1,0,1,co)", + "#(argb,8,8,3)color(0,1,0,1,co)", + "#(argb,8,8,3)color(0,0,1,1,co)", + "#(argb,8,8,3)color(0.2,0,0.5,1,co)", + "#(argb,8,8,3)color(0.5,0,1,1,co)" + ]; + _index = 0; + while {True} do { + for "_i" from 0 to (_hSCount - 1) do { + _vehicle setObjectTexture [_i, (_colors select _index)]; + }; + _index = (_index + 1) % 7; + sleep 0.02; + }; }; - _index = (_index + 1) % 7; - sleep 0.02; - }; }; - }; } count _units; diag_log text "[ACE]: WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE."; diff --git a/addons/common/functions/fnc_monitor.sqf b/addons/common/functions/fnc_monitor.sqf index dcb9e5163f..f77aa2dd7c 100644 --- a/addons/common/functions/fnc_monitor.sqf +++ b/addons/common/functions/fnc_monitor.sqf @@ -4,8 +4,8 @@ terminate (missionNamespace getVariable [QGVAR(MonitorFnc), scriptNull]); GVAR(MonitorFnc) = _this spawn { - waitUntil { - hintSilent str (call _this); - false - }; + waitUntil { + hintSilent str (call _this); + false + }; }; diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf index 5c496ea58e..1eceff744c 100644 --- a/addons/common/functions/fnc_muteUnit.sqf +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_reason"]; - -_unit = _this select 0; -_reason = _this select 1; +PARAMS_2(_unit,_reason); if (isNull _unit) exitWith {}; diff --git a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf index f0abcfcf01..a257a22ea0 100644 --- a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf +++ b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf @@ -1,9 +1,7 @@ // by commy2 #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); // setSpeaker gets overwritten after init on remote units; if unit is muted, setSpeaker again if (count (_unit getVariable [QGVAR(muteUnitReasons), []]) > 0) then { diff --git a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf index 021b083bfd..5cef18a0b3 100644 --- a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf +++ b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf @@ -1,9 +1,7 @@ // by commy2 #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); // setVariable is broken on JIP after respawn _unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true]; diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf index fe62ab626b..3545b53257 100644 --- a/addons/common/functions/fnc_numberToDigits.sqf +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -12,10 +12,9 @@ */ #include "script_component.hpp" -private ["_number", "_minLength", "_length", "_digits"]; +private ["_length", "_digits"]; -_number = _this select 0; -_minLength = _this select 1; +PARAMS_2(_number,_minLength); _number = _number min 999999; diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf index 24b3791d68..e42f246460 100644 --- a/addons/common/functions/fnc_numberToDigitsString.sqf +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -12,10 +12,9 @@ */ #include "script_component.hpp" -private ["_number", "_minLength", "_length"]; +private ["_length"]; -_number = _this select 0; -_minLength = _this select 1; +PARAMS_2(_number,_minLength); _number = _number min 999999; diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf index e0ebf1d77f..30efcd8955 100644 --- a/addons/common/functions/fnc_numberToString.sqf +++ b/addons/common/functions/fnc_numberToString.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_number", "_decimals"]; +private ["_decimals"]; -_number = _this select 0; +PARAMS_1(_number); _decimals = str (abs(_number) mod 1); _decimals = toArray _decimals; diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index aa3ae8fb45..a8dd2ce351 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -9,10 +9,9 @@ */ #include "script_component.hpp" -private ["_unit","_requestID", "_id", "_accepted", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; -_unit = _this select 0; -_id = _this select 1; -_accepted = _this select 2; +private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; + +PARAMS_3(_unit,_id,_accepted); _info = _unit getvariable _id; if (!isnil "_info") then { diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index 5588c23781..b76edb31c1 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -12,8 +12,6 @@ */ #include "script_component.hpp" -private "_target"; - -_target = _this select 0; +PARAMS_1(_target); !isNull (_target getVariable [QGVAR(owner), objNull]) diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index c92bb4ab94..0bf2693eba 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -16,11 +16,11 @@ if !(isServer) exitWith {}; -EXPLODE_3_PVT(_this,_logic,_settingName,_moduleVariable); +PARAMS_3(_logic,_settingName,_moduleVariable); // Check if the parameter is defined in the module if (isNil {_logic getVariable _moduleVariable}) exitWith { - diag_log text format["[ACE]: Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleVariable]; + diag_log text format["[ACE]: Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleVariable]; }; // Set the setting globally and force it diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index c74a69013d..e6c39c1959 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -10,12 +10,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -_caller = _this select 0; -_target = _this select 1; -_requestID = _this select 2; -_requestMessage = _this select 3; -_callBack = _this select 4; +PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack); _requestID = ("ace_recieveRequest_f_id_"+_requestID); @@ -65,5 +60,4 @@ GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { _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_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf index 2bcc970ab0..693741d193 100644 --- a/addons/common/functions/fnc_removeActionEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_unit", "_action", "_id", "_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs", "_count"]; +private ["_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs", "_count"]; -_unit = _this select 0; -_action = _this select 1; -_id = _this select 2; +PARAMS_3(_unit,_action,_id); if (_id == -1) exitWith {}; @@ -45,8 +43,8 @@ _actions set [_id, []]; _actions = _actions - [[]]; if (count _actions == 0) then { - _unit removeAction _actionID; - _actionID = -1; + _unit removeAction _actionID; + _actionID = -1; }; _unit setVariable [_name, [_actionID, [_currentID, _actionIDs, _actions], _unit], false]; diff --git a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf index 7c45bae112..b45476a3da 100644 --- a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_unit", "_action", "_id", "_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; +private ["_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; -_unit = _this select 0; -_action = _this select 1; -_id = _this select 2; +PARAMS_3(_unit,_action,_id); if (_id == -1) exitWith {}; diff --git a/addons/common/functions/fnc_removeAllEventHandlers.sqf b/addons/common/functions/fnc_removeAllEventHandlers.sqf index 170d4f8cbb..6bf4dc742a 100644 --- a/addons/common/functions/fnc_removeAllEventHandlers.sqf +++ b/addons/common/functions/fnc_removeAllEventHandlers.sqf @@ -10,12 +10,12 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventNames", "_eventFunctions", "_eventIndex"]; -_eventName = _this select 0; +private ["_eventNames", "_eventFunctions", "_eventIndex"]; +PARAMS_1(_eventName); _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { - (GVAR(events) select 1) set[_eventIndex, []]; +if (_eventIndex != -1) then { + (GVAR(events) select 1) set [_eventIndex, []]; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index d87c72933d..16954d5523 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -11,14 +11,15 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventNames", "_eventFunctions", "_eventIndex", "_eventCodeIndex"]; -_eventName = _this select 0; -_eventCodeIndex = _this select 1; +private ["_eventNames", "_eventFunctions", "_eventIndex"]; + +PARAMS_2(_eventName,_eventCodeIndex); _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { + +if (_eventIndex != -1) then { _eventFunctions = (GVAR(events) select 1) select _eventIndex; _eventFunctions set[_eventCodeIndex, nil]; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf index 0f31b5e886..39225bf9dd 100644 --- a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; +private ["_actionsVar", "_currentId", "_actionIDs", "_actions"]; -_id = _this select 0; +PARAMS_1(_id); _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; diff --git a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf index 914064538d..ff7c0c281e 100644 --- a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; +private ["_actionsVar", "_currentId", "_actionIDs", "_actions"]; -_id = _this select 0; +PARAMS_1(_id); _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 6429120bbe..835b26e526 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" PARAMS_1(_name); -if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { diag_log text format["[ACE] Error, synced event key not found."]; false }; diff --git a/addons/common/functions/fnc_requestCallback.sqf b/addons/common/functions/fnc_requestCallback.sqf index b5c9312d3d..827519b99c 100644 --- a/addons/common/functions/fnc_requestCallback.sqf +++ b/addons/common/functions/fnc_requestCallback.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" -private ["_info", "_accepted", "_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -_info = _this select 0; -_accepted = _this select 1; +private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; +PARAMS_2(_info,_accepted); _caller = _info select 0; _target = _info select 1; diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 64a8e39fa6..efa69d9059 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -10,8 +10,9 @@ #include "script_component.hpp" -private ["_unit","_oldUnit","_sets"]; -_unit = _this select 0; +private ["_oldUnit","_sets"]; + +PARAMS_1(_unit); _unit setvariable ["ACE_isDead",nil,true]; _unit setvariable ["ACE_isUnconscious", nil, true]; @@ -35,6 +36,6 @@ if (isPlayer _unit) then { if (!(_x select 4)) then { _unit setvariable [(_x select 0),nil,_x select 3]; }; -}foreach ([_unit] call FUNC(getAllDefinedSetVariables)); +} forEach ([_unit] call FUNC(getAllDefinedSetVariables)); _unit setVariable ["ACE_forceWalkStatusNumber", 0, true]; diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index ca185082cb..9ca911d79c 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_unit", "_respawnVariables"]; +private "_respawnVariables"; -_unit = _this select 0; +PARAMS_1(_unit); _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; @@ -21,5 +21,5 @@ _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; _respawnVariables pushBack "ACE_PersistentFunctions"; { - _unit setVariable [_x, _unit getVariable _x, true]; + _unit setVariable [_x, _unit getVariable _x, true]; } forEach _respawnVariables; diff --git a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf index bdffb3a6c9..4acf460438 100644 --- a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf +++ b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf @@ -11,29 +11,29 @@ */ #include "script_component.hpp" -private ["_keyCode", "_key", "_alt", "_ctrl", "_shft"]; +private ["_key", "_alt", "_ctrl", "_shft"]; -_keyCode = _this select 0; +PARAMS_1(_keyCode); _key = toString ((toArray keyName floor _keyCode) - [34]); _keyCode = round ((_keyCode % 1) * 10); switch (_keyCode) do { - case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; - case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; - default { - _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); + case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; + case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; + default { + _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); - _alt = "1" == toString [_keyCode select 0]; - _ctrl = "1" == toString [_keyCode select 1]; - _shift = "1" == toString [_keyCode select 2]; + _alt = "1" == toString [_keyCode select 0]; + _ctrl = "1" == toString [_keyCode select 1]; + _shift = "1" == toString [_keyCode select 2]; - format ["%1%2%3%4", - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, - _key - ] - }; + format ["%1%2%3%4", + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, + _key + ] + }; }; diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index 85f743150e..2bc170872d 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -12,10 +12,10 @@ */ #include "script_component.hpp" -private ["_string", "_removeTags", "_array", "_arrayNew"]; +private ["_array", "_arrayNew"]; + +PARAMS_2(_string,_removeTags); -_string = _this select 0; -_removeTags = _this select 1; if (isNil "_removeTags") then {_removeTags = false}; _array = toArray _string; diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf index 33254fa81e..1ff209dac6 100644 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ b/addons/common/functions/fnc_sendDisplayInformationTo.sqf @@ -27,7 +27,7 @@ if (isPlayer _reciever) then { _localizationArray = [_title]; { _localizationArray pushback _x; - }foreach _parameters; + } forEach _parameters; _title = format _localizationArray; { @@ -35,7 +35,7 @@ if (isPlayer _reciever) then { _localizationArray = [localize _x]; { _localizationArray pushback _x; - }foreach _parameters; + } forEach _parameters; _content set [_foreachIndex, format _localizationArray]; }; diff --git a/addons/common/functions/fnc_sendRequest.sqf b/addons/common/functions/fnc_sendRequest.sqf index fdd88716e9..68b42ce302 100644 --- a/addons/common/functions/fnc_sendRequest.sqf +++ b/addons/common/functions/fnc_sendRequest.sqf @@ -10,12 +10,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_requestMessage", "_requestID", "_callBack"]; -_caller = _this select 0; -_target = _this select 1; -_requestID = _this select 2; -_requestMessage = _this select 3; -_callBack = _this select 4; +PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack); if (isPlayer _target) then { // Pass request on to target locality for player accept/decline. diff --git a/addons/common/functions/fnc_serverEvent.sqf b/addons/common/functions/fnc_serverEvent.sqf index b792323867..73bb77c600 100644 --- a/addons/common/functions/fnc_serverEvent.sqf +++ b/addons/common/functions/fnc_serverEvent.sqf @@ -11,10 +11,8 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventArgs"]; -_eventName = _this select 0; -_eventArgs = _this select 1; +PARAMS_2(_eventName,_eventArgs); #ifdef DEBUG_EVENTS diag_log text format[ARR_2("* Server Event: %1",_eventName)]; @@ -22,7 +20,7 @@ _eventArgs = _this select 1; #endif ACEg = [_eventName, _eventArgs]; -if(!isServer) then { +if (!isServer) then { publicVariableServer "ACEg"; } else { ["ACEg", ACEg] call FUNC(_handleNetEvent); diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf index 058b68b3cc..76560e45a3 100644 --- a/addons/common/functions/fnc_serverLog.sqf +++ b/addons/common/functions/fnc_serverLog.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" if (isServer) then { - diag_log _this; + diag_log _this; } else { - [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); + [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); }; diff --git a/addons/common/functions/fnc_setCanInteract.sqf b/addons/common/functions/fnc_setCanInteract.sqf index 091bbf8cc6..ae05d3cd5b 100644 --- a/addons/common/functions/fnc_setCanInteract.sqf +++ b/addons/common/functions/fnc_setCanInteract.sqf @@ -11,9 +11,11 @@ #include "script_component.hpp" private ["_unit","_to","_return"]; + _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; diff --git a/addons/common/functions/fnc_setCaptivityStatus.sqf b/addons/common/functions/fnc_setCaptivityStatus.sqf index b943fce4ab..f579b5cfbc 100644 --- a/addons/common/functions/fnc_setCaptivityStatus.sqf +++ b/addons/common/functions/fnc_setCaptivityStatus.sqf @@ -13,20 +13,18 @@ */ #include "script_component.hpp" -private ["_unit", "_reason", "_status", "_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; +private ["_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; -_unit = _this select 0; -_reason = _this select 1; -_status = _this select 2; +PARAMS_3(_unit,_reason,_status); _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; // register new reason (these reasons are shared publicly, since units can change ownership, but keep their captivity status) if !(_reason in _captivityReasons) then { - _captivityReasons pushBack _reason; + _captivityReasons pushBack _reason; - ACE_captivityReasons = _captivityReasons; - publicVariable "ACE_captivityReasons"; + ACE_captivityReasons = _captivityReasons; + publicVariable "ACE_captivityReasons"; }; // get reasons why the unit is captive already and update to the new status @@ -34,7 +32,7 @@ _unitCaptivityReasons = [_unit] call FUNC(getCaptivityStatus); _captivityReasonsBooleans = []; { - _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; + _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; } forEach _captivityReasons; _captivityReasonsBooleans set [_captivityReasons find _reason, _status]; diff --git a/addons/common/functions/fnc_setDefinedVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf index b2eece4424..54bc8d0c5f 100644 --- a/addons/common/functions/fnc_setDefinedVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -10,10 +10,10 @@ #include "script_component.hpp" -private ["_unit","_variable","_value","_update","_global","_definedVariable","_defaultGlobal","_currentValue"]; -_unit = _this select 0; -_variable = _this select 1; -_value = _this select 2; +private ["_update","_global","_definedVariable","_defaultGlobal","_currentValue"]; + +PARAMS_3(_unit,_variable,_value); + _global = false; if (count _this > 3) then { diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf index 2cf25b827a..8836f4cd0d 100644 --- a/addons/common/functions/fnc_setDisableUserInputStatus.sqf +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -8,10 +8,8 @@ * @PublicAPI: true */ #include "script_component.hpp" -private ["_id","_disable"]; -_id = _this select 0; -_disable = _this select 1; +PARAMS_2(_id,_disable); if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { GVAR(DISABLE_USER_INPUT_COLLECTION) = []; diff --git a/addons/common/functions/fnc_setForceWalkStatus.sqf b/addons/common/functions/fnc_setForceWalkStatus.sqf index 477f76297d..9935f4ad21 100644 --- a/addons/common/functions/fnc_setForceWalkStatus.sqf +++ b/addons/common/functions/fnc_setForceWalkStatus.sqf @@ -20,11 +20,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_reason", "_status", "_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; +private ["_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; -_unit = _this select 0; -_reason = _this select 1; -_status = _this select 2; +PARAMS_3(_unit,_reason,_status); _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 76837b4433..3e2939d29b 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -10,10 +10,11 @@ #include "script_component.hpp" -private ["_id", "_settings", "_add", "_exists", "_map", "_lowestVolume"]; -_id = _this select 0; -_settings = _this select 1; -_add = true; +private ["_add", "_exists", "_map", "_lowestVolume"]; + +PARAMS_2(_id,_settings); + +_add = true; if (count _this > 2) then { _add = _this select 2; }; diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index d50d5b1987..980408fb12 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -11,16 +11,16 @@ */ #include "script_component.hpp" -private ["_unit", "_name"]; +private ["_name"]; -_unit = _this select 0; +PARAMS_1(_unit); if (isNull _unit || {!alive _unit}) exitWith {}; if (_unit isKindOf "CAManBase") then { - _name = [name _unit, true] call FUNC(sanitizeString); - - //if (_name != _unit getVariable ["ACE_Name", ""]) then { + _name = [name _unit, true] call FUNC(sanitizeString); + + //if (_name != _unit getVariable ["ACE_Name", ""]) then { _unit setVariable ["ACE_Name", _name, true]; - //}; + //}; }; diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf index 4dbc5fc84e..d7a4573935 100644 --- a/addons/common/functions/fnc_setParameter.sqf +++ b/addons/common/functions/fnc_setParameter.sqf @@ -12,16 +12,13 @@ */ #include "script_component.hpp" - private ["_name", "_value"]; - -_name = _this select 0; -_value = _this select 1; +PARAMS_2(_name,_value); // Hack to keep backward compatibility for the moment if ((typeName (missionNamespace getVariable _name)) == "BOOL") then { - if ((typeName _value) == "SCALAR") then { - _value = _value > 0; - }; + if ((typeName _value) == "SCALAR") then { + _value = _value > 0; + }; }; missionNamespace setVariable [_name, _value]; diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index 84ba255758..8effc3680d 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -17,9 +17,9 @@ */ #include "script_component.hpp" -private ["_name","_value", "_force", "_settingData","_failed"]; -_name = _this select 0; -_value = _this select 1; +private ["_force", "_settingData","_failed"]; + +PARAMS_2(_name,_value); private ["_force"]; _force = false; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 0b5d4ab767..adb9f7ef35 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_optionEntry); +PARAMS_1(_optionEntry); private ["_fnc_getValueWithType", "_value","_name", "_typeName", "_settingData"]; diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf index 8e790353f4..8177e97473 100644 --- a/addons/common/functions/fnc_setVariableJIP.sqf +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_unit", "_varName", "_value", "_respawnVariables"]; +private ["_respawnVariables"]; -_unit = _this select 0; -_varName = _this select 1; -_value = _this select 2; +PARAMS_3(_unit,_varName,_value); _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 81093a2679..791be6ad9c 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -14,12 +14,7 @@ */ #include "script_component.hpp" -private ["_object", "_varName", "_value", "_sync"]; - -_object = _this select 0; -_varName = _this select 1; -_value = _this select 2; -_sync = _this select 3; +PARAMS_4(_object,_varName,_value,_sync); if (isNil "_sync") then { _sync = 1; diff --git a/addons/common/functions/fnc_showUser.sqf b/addons/common/functions/fnc_showUser.sqf index a5d602251d..a88d39ce0d 100644 --- a/addons/common/functions/fnc_showUser.sqf +++ b/addons/common/functions/fnc_showUser.sqf @@ -1,10 +1,8 @@ // by commy2 #include "script_component.hpp" -private "_object"; - GVAR(Debug_Object) = _this select 0; onEachFrame { - hintSilent str (GVAR(Debug_Object) getVariable ["ACE_isUsedBy", objNull]); + hintSilent str (GVAR(Debug_Object) getVariable ["ACE_isUsedBy", objNull]); }; diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 1d2a2af1bf..db142b01b6 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -10,9 +10,9 @@ #include "script_component.hpp" -private ["_array", "_elements", "_elementN", "_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; -_array = _this select 0; -_elementN = _this select 1; +private ["_elements","_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; + +PARAMS_2(_array,_elementN); _indexes = []; _elements = []; @@ -21,7 +21,7 @@ _elements = []; _theElement = toArray (_x select _elementN); _indexes pushback _foreachIndex; _elements pushback _theElement; -}foreach _array; +} forEach _array; for "_i" from 1 to (count _elements) - 1 do { _tmp = _elements select _i; @@ -39,6 +39,6 @@ for "_i" from 1 to (count _elements) - 1 do { _returnArray = []; { _returnArray pushback (_array select _x); -}foreach _indexes; +} forEach _indexes; _returnArray; \ No newline at end of file diff --git a/addons/common/functions/fnc_subString.sqf b/addons/common/functions/fnc_subString.sqf index 2389dbed00..eeadfffa62 100644 --- a/addons/common/functions/fnc_subString.sqf +++ b/addons/common/functions/fnc_subString.sqf @@ -13,16 +13,14 @@ */ #include "script_component.hpp" -_string = _this select 0; -_index = _this select 1; -_length = _this select 2; +PARAMS_3(_string,_index,_length); _array = toArray _string; if (_index < 0 or _length < 0 or _index + _length > (count _array) + 1) exitWith {false}; _arrayNew = []; for "_i" from _index to (_index + _length - 1) do { - _arrayNew = _arrayNew + [(_array select _i)]; + _arrayNew = _arrayNew + [(_array select _i)]; }; toString _arrayNew diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 70c30a19da..2ceb77b073 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -13,7 +13,9 @@ */ //#define DEBUG_MODE_FULL #include "script_component.hpp" + PARAMS_2(_name,_args); + private["_ttl", "_eventData", "_internalData", "_eventLog"]; if( (count _this) > 2) then { diff --git a/addons/common/functions/fnc_targetEvent.sqf b/addons/common/functions/fnc_targetEvent.sqf index 7299eeb057..cb78c29c18 100644 --- a/addons/common/functions/fnc_targetEvent.sqf +++ b/addons/common/functions/fnc_targetEvent.sqf @@ -15,11 +15,8 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventArgs", "_eventTargets"]; -_eventName = _this select 0; -_eventTargets = _this select 1; -_eventArgs = _this select 2; +PARAMS_3(_eventName,_eventTargets,_eventArgs); #ifdef DEBUG_EVENTS diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)]; diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index e5e30b6664..3fc5fb288b 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_unit,_varName,_maxDelay); +PARAMS_3(_unit,_varName,_maxDelay); // Create the publish scheduler PFH the first time if (isNil QGVAR(publishSchedId)) then { diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf index 4fdcded607..7c666f2f73 100644 --- a/addons/common/functions/fnc_toBin.sqf +++ b/addons/common/functions/fnc_toBin.sqf @@ -12,10 +12,9 @@ A binary number, String */ #include "script_component.hpp" -private ["_number", "_minLength", "_sign", "_bin", "_rest"]; +private ["_sign", "_bin", "_rest"]; -_number = _this select 0; -_minLength = _this select 1; +PARAMS_2(_number,_minLength); if (isNil "_minLength") then {_minLength = 1}; @@ -25,14 +24,13 @@ _number = round abs _number; _bin = ["", "0"] select (_number == 0); while {_number > 0} do { - _rest = str (_number mod 2); - _number = floor (_number / 2); - - _bin = _rest + _bin; + _rest = str (_number mod 2); + _number = floor (_number / 2); + _bin = _rest + _bin; }; while {count toArray _bin < _minLength} do { - _bin = "0" + _bin; + _bin = "0" + _bin; }; _sign + _bin diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index eb69e67621..14ddb90541 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -17,7 +17,7 @@ _array = _this; _result = 0; { - if (_x) then {_result = _result + 2 ^ _forEachIndex}; + if (_x) then {_result = _result + 2 ^ _forEachIndex}; } forEach _array; _result diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index fc481398d3..9c4203e07e 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -19,7 +19,7 @@ #include "script_component.hpp" if (typeName (_this select 0) == "SCALAR") exitWith { - (_this select 0) + (_this select 0) }; (parseNumber (_this select 0)) \ No newline at end of file diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index 21d42072da..c81efb8308 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -10,8 +10,8 @@ #include "script_component.hpp" -private ["_array", "_result", "_value"]; -_array = _this select 0; +private ["_result", "_value"]; +PARAMS_1(_array); _result = []; { @@ -19,6 +19,6 @@ _result = []; if ({_x isEqualTo _value} count _result == 0) then { _result pushback _x; }; -}foreach _array; +} forEach _array; _result; \ No newline at end of file diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index 60e4f56d7d..4db16a50a8 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -15,8 +15,8 @@ #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) -private ["_unit","_vehicle", "_loaded", "_emptyPos"]; -_unit = _this select 0; +private ["_vehicle", "_loaded", "_emptyPos"]; +PARAMS_1(_unit); _vehicle = vehicle _unit; if (_vehicle == _unit) exitwith {false;}; diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index 94ba72f5a4..24b74785de 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_reason"]; - -_unit = _this select 0; -_reason = _this select 1; +PARAMS_2(_unit,_reason); if (isNull _unit) exitWith {}; diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index d03ec4d156..cc4d0491fd 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" -private ["_unit","_item","_return"]; -_unit = _this select 0; -_item = _this select 1; +private ["_return"]; +PARAMS_2(_unit,_item); _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; _return = false; diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index 726e169383..e29c3489ef 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" -private ["_unit","_magazine","_return"]; -_unit = _this select 0; -_magazine = _this select 1; +private ["_return"]; +PARAMS_2(_unit,_magazine); _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; if (!_vehicleUsage) then { @@ -24,7 +23,6 @@ if (!_vehicleUsage) then { }; [format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug); _return -} else -{ +} else { // TODO implement shared magazine functionality }; \ No newline at end of file diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index 777cd72c0a..41301f0f29 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_func,_params,_delay,_interval); +PARAMS_4(_func,_params,_delay,_interval); [ { diff --git a/addons/explosives/ACE_Settings.hpp b/addons/explosives/ACE_Settings.hpp new file mode 100644 index 0000000000..038f06291d --- /dev/null +++ b/addons/explosives/ACE_Settings.hpp @@ -0,0 +1,10 @@ +class ACE_Settings { + class GVAR(RequireSpecialist) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(PunishNonSpecialists) { + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index e77d2bf624..873c4e0dc3 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -40,13 +40,4 @@ class CfgMineTriggers { }; }; -class ACE_Settings { - class GVAR(RequireSpecialist) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(PunishNonSpecialists) { - value = 1; - typeName = "BOOL"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/goggles/ACE_Settings.hpp b/addons/goggles/ACE_Settings.hpp new file mode 100644 index 0000000000..e25da3c274 --- /dev/null +++ b/addons/goggles/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(showInThirdPerson) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; + }; +}; diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index 7e8afe4d3d..c557827e17 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -243,14 +243,7 @@ class SniperCloud { ACE_Goggles_BulletCount = 1; }; -class ACE_Settings { - class GVAR(showInThirdPerson) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; - }; -}; +#include "ACE_Settings.hpp" class CfgCloudlets { class Default; diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp new file mode 100644 index 0000000000..a196b4affc --- /dev/null +++ b/addons/hearing/ACE_Settings.hpp @@ -0,0 +1,20 @@ +class ACE_Settings { + class GVAR(EnableCombatDeafness) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(EarplugsVolume) { + value = 0.5; + typeName = "SCALAR"; + }; + class GVAR(UnconsciousnessVolume) { + value = 0.4; + typeName = "SCALAR"; + }; + class GVAR(DisableEarRinging) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Hearing_DisableEarRinging"; + }; +}; diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 0813d0648e..777c44dd8f 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -22,23 +22,4 @@ class CfgPatches { #include "CfgAmmo.hpp" -class ACE_Settings { - class GVAR(EnableCombatDeafness) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(EarplugsVolume) { - value = 0.5; - typeName = "SCALAR"; - }; - class GVAR(UnconsciousnessVolume) { - value = 0.4; - typeName = "SCALAR"; - }; - class GVAR(DisableEarRinging) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Hearing_DisableEarRinging"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/interact_menu/ACE_Settings.hpp b/addons/interact_menu/ACE_Settings.hpp new file mode 100644 index 0000000000..19347b0d6d --- /dev/null +++ b/addons/interact_menu/ACE_Settings.hpp @@ -0,0 +1,72 @@ +class ACE_Settings { + class GVAR(AlwaysUseCursorSelfInteraction) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction"; + }; + class GVAR(cursorKeepCentered) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_cursorKeepCentered"; + description = "$STR_ACE_Interact_cursorKeepCenteredDescription"; + }; + class GVAR(AlwaysUseCursorInteraction) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorInteraction"; + }; + class GVAR(UseListMenu) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_UseListMenu"; + }; + class GVAR(colorTextMax) { + value[] = {1, 1, 1, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorTextMax"; + }; + class GVAR(colorTextMin) { + value[] = {1, 1, 1, 0.25}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorTextMin"; + }; + class GVAR(colorShadowMax) { + value[] = {0, 0, 0, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorShadowMax"; + }; + class GVAR(colorShadowMin) { + value[] = {0, 0, 0, 0.25}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorShadowMin"; + }; + class GVAR(textSize) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_textSize"; + values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + }; + class GVAR(shadowSetting) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_shadowSetting"; + description = "$STR_ACE_Interact_shadowSettingDescription"; + values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", "$STR_ACE_Interact_shadowOutline"}; + }; + class GVAR(actionOnKeyRelease) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ActionOnKeyRelease"; + }; +}; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 52f2f6b9f9..c1da3392e9 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -18,78 +18,7 @@ class CfgPatches { #include "CursorMenus.hpp" -class ACE_Settings { - class GVAR(AlwaysUseCursorSelfInteraction) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction"; - }; - class GVAR(cursorKeepCentered) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_cursorKeepCentered"; - description = "$STR_ACE_Interact_cursorKeepCenteredDescription"; - }; - class GVAR(AlwaysUseCursorInteraction) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorInteraction"; - }; - class GVAR(UseListMenu) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_UseListMenu"; - }; - class GVAR(colorTextMax) { - value[] = {1, 1, 1, 1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorTextMax"; - }; - class GVAR(colorTextMin) { - value[] = {1, 1, 1, 0.25}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorTextMin"; - }; - class GVAR(colorShadowMax) { - value[] = {0, 0, 0, 1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorShadowMax"; - }; - class GVAR(colorShadowMin) { - value[] = {0, 0, 0, 0.25}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorShadowMin"; - }; - class GVAR(textSize) { - value = 2; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_textSize"; - values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; - }; - class GVAR(shadowSetting) { - value = 2; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_shadowSetting"; - description = "$STR_ACE_Interact_shadowSettingDescription"; - values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", "$STR_ACE_Interact_shadowOutline"}; - }; - class GVAR(actionOnKeyRelease) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ActionOnKeyRelease"; - }; -}; +#include "ACE_Settings.hpp" class ACE_Extensions { extensions[] += {"ace_break_line"}; diff --git a/addons/interaction/ACE_Settings.hpp b/addons/interaction/ACE_Settings.hpp new file mode 100644 index 0000000000..6c97109a37 --- /dev/null +++ b/addons/interaction/ACE_Settings.hpp @@ -0,0 +1,6 @@ +class ACE_Settings { + class GVAR(EnableTeamManagement) { + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 7d10e1bef5..7a68b2c12a 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -15,10 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "Menu_Config.hpp" - -class ACE_Settings { - class GVAR(EnableTeamManagement) { - value = 1; - typeName = "BOOL"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/inventory/ACE_Settings.hpp b/addons/inventory/ACE_Settings.hpp new file mode 100644 index 0000000000..9e1b7fc15a --- /dev/null +++ b/addons/inventory/ACE_Settings.hpp @@ -0,0 +1,10 @@ +class ACE_Settings { + class GVAR(inventoryDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_Inventory_SettingName"; + description = "$STR_ACE_Inventory_SettingDescription"; + values[] = {"$str_medium", "$str_large", "$str_very_large"}; + }; +}; \ No newline at end of file diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 622dacc624..1190525901 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -13,15 +13,4 @@ class CfgPatches { }; #include "RscDisplayInventory.hpp" - -class ACE_Settings { - class GVAR(inventoryDisplaySize) { - value = 0; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_Inventory_SettingName"; - description = "$STR_ACE_Inventory_SettingDescription"; - values[] = {"$str_medium", "$str_large", "$str_very_large"}; - }; -}; - +#include "ACE_Settings.hpp" diff --git a/addons/magazinerepack/ACE_Settings.hpp b/addons/magazinerepack/ACE_Settings.hpp new file mode 100644 index 0000000000..0b7b2d4628 --- /dev/null +++ b/addons/magazinerepack/ACE_Settings.hpp @@ -0,0 +1,17 @@ +class ACE_Settings { + //Time to move a round from one magazine to another + class GVAR(TimePerAmmo) { + value = 1.5; + typeName = "SCALAR"; + }; + //Time to swap between magazines when repacking + class GVAR(TimePerMagazine) { + value = 2.0; + typeName = "SCALAR"; + }; + //Time to relink 2 belts together + class GVAR(TimePerBeltLink) { + value = 8.0; + typeName = "SCALAR"; + }; +}; diff --git a/addons/magazinerepack/config.cpp b/addons/magazinerepack/config.cpp index 7c921889a1..47c0ac889c 100644 --- a/addons/magazinerepack/config.cpp +++ b/addons/magazinerepack/config.cpp @@ -15,21 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgSounds.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - //Time to move a round from one magazine to another - class GVAR(TimePerAmmo) { - value = 1.5; - typeName = "SCALAR"; - }; - //Time to swap between magazines when repacking - class GVAR(TimePerMagazine) { - value = 2.0; - typeName = "SCALAR"; - }; - //Time to relink 2 belts together - class GVAR(TimePerBeltLink) { - value = 8.0; - typeName = "SCALAR"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp new file mode 100644 index 0000000000..15e2a174e4 --- /dev/null +++ b/addons/map/ACE_Settings.hpp @@ -0,0 +1,30 @@ +class ACE_Settings { + class GVAR(BFT_Interval) { + value = 1.0; + typeName = "SCALAR"; + }; + class GVAR(BFT_Enabled) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(BFT_HideAiGroups) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(mapIllumination) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapShake) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapLimitZoom) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(mapShowCursorCoordinates) { + value = 0; + typeName = "BOOL"; + }; +}; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 9d75eaa5c8..078c06b41d 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -23,37 +23,7 @@ class RscButtonMenuCancel; class RscButtonMenu; class RscEdit; -class ACE_Settings { - class GVAR(BFT_Interval) { - value = 1.0; - typeName = "SCALAR"; - }; - class GVAR(BFT_Enabled) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(BFT_HideAiGroups) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(mapIllumination) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(mapShake) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(mapLimitZoom) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(mapShowCursorCoordinates) { - value = 0; - typeName = "BOOL"; - }; -}; - +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgMarkers.hpp" #include "CfgVehicles.hpp" diff --git a/addons/maptools/ACE_Settings.hpp b/addons/maptools/ACE_Settings.hpp new file mode 100644 index 0000000000..9c53a84a7c --- /dev/null +++ b/addons/maptools/ACE_Settings.hpp @@ -0,0 +1,6 @@ +class ACE_Settings { + class GVAR(EveryoneCanDrawOnBriefing) { + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/maptools/config.cpp b/addons/maptools/config.cpp index ab11fdceec..1e82cd2269 100644 --- a/addons/maptools/config.cpp +++ b/addons/maptools/config.cpp @@ -12,12 +12,7 @@ class CfgPatches { }; }; -class ACE_Settings { - class GVAR(EveryoneCanDrawOnBriefing) { - value = 1; - typeName = "BOOL"; - }; -}; +#include "ACE_Settings.hpp" class RscControlsGroup; class RscActiveText; diff --git a/addons/microdagr/ACE_Settings.hpp b/addons/microdagr/ACE_Settings.hpp new file mode 100644 index 0000000000..db175e7303 --- /dev/null +++ b/addons/microdagr/ACE_Settings.hpp @@ -0,0 +1,7 @@ +class ACE_Settings { + class GVAR(MapDataAvailable) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 0; + }; +}; \ No newline at end of file diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp index 4e459c126c..69032eafde 100644 --- a/addons/microdagr/config.cpp +++ b/addons/microdagr/config.cpp @@ -16,11 +16,4 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgVehicles.hpp" #include "gui.hpp" - -class ACE_Settings { - class GVAR(MapDataAvailable) { - value = 2; - typeName = "SCALAR"; - isClientSettable = 0; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/mk6mortar/ACE_Settings.hpp b/addons/mk6mortar/ACE_Settings.hpp new file mode 100644 index 0000000000..be7625bc3a --- /dev/null +++ b/addons/mk6mortar/ACE_Settings.hpp @@ -0,0 +1,18 @@ +class ACE_Settings { + //These settings effect gameplay difficutly: defaults will leave the mortar the same as vanilla + class GVAR(airResistanceEnabled) { + value = 0; + typeName = "BOOL"; + isClientSetable = 0; + }; + class GVAR(allowComputerRangefinder) { + value = 1; + typeName = "BOOL"; + isClientSetable = 0; + }; + class GVAR(allowCompass) { + value = 1; + typeName = "BOOL"; + isClientSetable = 0; + }; +}; diff --git a/addons/mk6mortar/config.cpp b/addons/mk6mortar/config.cpp index 6751cea5fb..bbd7a2f892 100644 --- a/addons/mk6mortar/config.cpp +++ b/addons/mk6mortar/config.cpp @@ -26,22 +26,4 @@ class RscActiveText; #include "RscInGameUI.hpp" #include "RscRangeTable.hpp" - -class ACE_Settings { - //These settings effect gameplay difficutly: defaults will leave the mortar the same as vanilla - class GVAR(airResistanceEnabled) { - value = 0; - typeName = "BOOL"; - isClientSetable = 0; - }; - class GVAR(allowComputerRangefinder) { - value = 1; - typeName = "BOOL"; - isClientSetable = 0; - }; - class GVAR(allowCompass) { - value = 1; - typeName = "BOOL"; - isClientSetable = 0; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/movement/ACE_Settings.hpp b/addons/movement/ACE_Settings.hpp new file mode 100644 index 0000000000..05b38106f3 --- /dev/null +++ b/addons/movement/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(useImperial) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Movement_UseImperial"; + }; +}; \ No newline at end of file diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index 6cf2c9470c..496e4982ac 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -16,12 +16,4 @@ class CfgPatches { #include "CfgFatigue.hpp" //#include "CfgInventoryGlobalVariable.hpp" #include "CfgMoves.hpp" - -class ACE_Settings { - class GVAR(useImperial) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Movement_UseImperial"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/optionsmenu/ACE_Settings.hpp b/addons/optionsmenu/ACE_Settings.hpp new file mode 100644 index 0000000000..ad910e4661 --- /dev/null +++ b/addons/optionsmenu/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(optionMenuDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_optionsMenu_uiScaing"; + values[] = {"$str_medium", "$str_large", "$str_very_large"}; + }; +}; diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 36389568d3..17e4887db6 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -27,16 +27,7 @@ class CfgAddons { #include "gui\pauseMenu.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - class GVAR(optionMenuDisplaySize) { - value = 0; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_optionsMenu_uiScaing"; - values[] = {"$str_medium", "$str_large", "$str_very_large"}; - }; -}; +#include "ACE_Settings.hpp" class ACE_Extensions { extensions[] += {"ace_clipboard"}; diff --git a/addons/overheating/ACE_Settings.hpp b/addons/overheating/ACE_Settings.hpp new file mode 100644 index 0000000000..f68898c434 --- /dev/null +++ b/addons/overheating/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(DisplayTextOnJam) { + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + displayName = "$STR_ACE_overheating_SettingDisplayTextName"; + description = "$STR_ACE_overheating_SettingDisplayTextDesc"; + }; +}; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index bd6cdbbdd3..0e899e1b25 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -20,13 +20,5 @@ class CfgPatches { #include "CfgWeapons.hpp" -class ACE_Settings { - class GVAR(DisplayTextOnJam) { - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - displayName = "$STR_ACE_overheating_SettingDisplayTextName"; - description = "$STR_ACE_overheating_SettingDisplayTextDesc"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/reload/ACE_Settings.hpp b/addons/reload/ACE_Settings.hpp new file mode 100644 index 0000000000..ce122a28f8 --- /dev/null +++ b/addons/reload/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(DisplayText) { + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + displayName = "$STR_ACE_reload_SettingDisplayTextName"; + description = "$STR_ACE_reload_SettingDisplayTextDesc"; + }; +}; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 02f5014379..6ded1cd687 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -22,13 +22,4 @@ class CfgPatches { #include "RscInGameUI.hpp" -class ACE_Settings { - class GVAR(DisplayText) { - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - displayName = "$STR_ACE_reload_SettingDisplayTextName"; - description = "$STR_ACE_reload_SettingDisplayTextDesc"; - }; -}; - +#include "ACE_Settings.hpp" diff --git a/addons/respawn/ACE_Settings.hpp b/addons/respawn/ACE_Settings.hpp new file mode 100644 index 0000000000..5c947b8670 --- /dev/null +++ b/addons/respawn/ACE_Settings.hpp @@ -0,0 +1,14 @@ +class ACE_Settings { + class GVAR(SavePreDeathGear) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(RemoveDeadBodiesDisconnected) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(BodyRemoveTimer) { + value = 0; + typeName = "SCALAR"; + }; +}; diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index 05f4ee2aa8..daed5e2ab0 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -16,18 +16,4 @@ class CfgPatches { #include "CfgAddons.hpp" #include "CfgVehicleClasses.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - class GVAR(SavePreDeathGear) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(RemoveDeadBodiesDisconnected) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(BodyRemoveTimer) { - value = 0; - typeName = "SCALAR"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/switchunits/ACE_Settings.hpp b/addons/switchunits/ACE_Settings.hpp new file mode 100644 index 0000000000..06c1ff274c --- /dev/null +++ b/addons/switchunits/ACE_Settings.hpp @@ -0,0 +1,30 @@ +class ACE_Settings { + class GVAR(EnableSwitchUnits) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToWest) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToEast) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToIndependent) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToCivilian) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(EnableSafeZone) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(SafeZoneRadius) { + value = 100; + typeName = "SCALAR"; + }; +}; diff --git a/addons/switchunits/config.cpp b/addons/switchunits/config.cpp index cda974d17e..8e792381c3 100644 --- a/addons/switchunits/config.cpp +++ b/addons/switchunits/config.cpp @@ -14,34 +14,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - class GVAR(EnableSwitchUnits) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToWest) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToEast) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToIndependent) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToCivilian) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(EnableSafeZone) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(SafeZoneRadius) { - value = 100; - typeName = "SCALAR"; - }; -}; +#include "ACE_Settings.hpp" \ No newline at end of file diff --git a/addons/vehiclelock/ACE_Settings.hpp b/addons/vehiclelock/ACE_Settings.hpp new file mode 100644 index 0000000000..9eac505db2 --- /dev/null +++ b/addons/vehiclelock/ACE_Settings.hpp @@ -0,0 +1,14 @@ +class ACE_Settings { + class GVAR(DefaultLockpickStrength) { + value = 10; + typeName = "SCALAR"; + }; + class GVAR(LockVehicleInventory) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(VehicleStartingLockState) { + value = -1; + typeName = "SCALAR"; + }; +}; \ No newline at end of file diff --git a/addons/vehiclelock/config.cpp b/addons/vehiclelock/config.cpp index 76d5817d8d..9ee1343bc8 100644 --- a/addons/vehiclelock/config.cpp +++ b/addons/vehiclelock/config.cpp @@ -12,21 +12,7 @@ class CfgPatches { }; }; -class ACE_Settings { - class GVAR(DefaultLockpickStrength) { - value = 10; - typeName = "SCALAR"; - }; - class GVAR(LockVehicleInventory) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(VehicleStartingLockState) { - value = -1; - typeName = "SCALAR"; - }; -}; - +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" diff --git a/addons/weaponselect/ACE_Settings.hpp b/addons/weaponselect/ACE_Settings.hpp new file mode 100644 index 0000000000..34fdc809ea --- /dev/null +++ b/addons/weaponselect/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(DisplayText) { + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + displayName = "$STR_ACE_Weaponselect_SettingDisplayTextName"; + description = "$STR_ACE_Weaponselect_SettingDisplayTextDesc"; + }; +}; diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp index 68d0fe842d..231d167cd0 100644 --- a/addons/weaponselect/config.cpp +++ b/addons/weaponselect/config.cpp @@ -13,13 +13,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class ACE_Settings { - class GVAR(DisplayText) { - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - displayName = "$STR_ACE_Weaponselect_SettingDisplayTextName"; - description = "$STR_ACE_Weaponselect_SettingDisplayTextDesc"; - }; -}; +#include "ACE_Settings.hpp"