diff --git a/AUTHORS.txt b/AUTHORS.txt index 190b12bb6a..a11e39d78e 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -191,3 +191,4 @@ YetheSamartaka xrufix Zakant zGuba +Zman6258 diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index a167d027f3..b41fd7a7c0 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -17,7 +17,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!alive _projectile) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 6af9efca24..89e89b9f7e 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -22,7 +22,7 @@ private _initStartTime = diag_tickTime; private _mapSize = worldSize; if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { - INFO_1("Terrain already initialized [world: %1]", worldName); + INFO_1("Terrain already initialized [world: %1]",worldName); #ifdef DEBUG_MODE_FULL systemChat "AdvancedBallistics: Terrain already initialized"; #endif @@ -33,14 +33,14 @@ private _gridCells = _mapGrids * _mapGrids; GVAR(currentGrid) = 0; -INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldName); +INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName); [{ params ["_args","_idPFH"]; _args params ["_mapGrids", "_gridCells", "_initStartTime"]; if (GVAR(currentGrid) >= _gridCells) exitWith { - INFO_2("Finished terrain initialization in %1 seconds [world: %2]", (diag_tickTime - _initStartTime) toFixed 2, worldName); + INFO_2("Finished terrain initialization in %1 seconds [world: %2]",(diag_tickTime - _initStartTime) toFixed 2,worldName); #ifdef DEBUG_MODE_FULL systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2]; #endif @@ -53,7 +53,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa private _gridCenter = [_x + 25, _y + 25]; private _gridHeight = round(getTerrainHeightASL _gridCenter); private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); - private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0}; + private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter); "ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater]; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 103ce3d1cd..d6081e6f9e 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -66,7 +66,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then { if (_inheritedBarrelConfig || _inheritedTempConfig) then { private _parentConfig = inheritsFrom _ammoConfig; private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed"); - WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed); + WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig,_parentSpeed); if (_parentSpeed <= 0) exitWith {//Handle weird or null parent _muzzleVelocityTable = []; _ammoTempMuzzleVelocityShifts = []; diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index bf0e23f97c..c79aeaf2ea 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -21,7 +21,7 @@ private _weaponConfig = (configFile >> "CfgWeapons" >> _this); private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist"); -private _twistDirection = [0, 1] select (_barrelTwist != 0); +private _twistDirection = parseNumber (_barrelTwist != 0); if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { _twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection"); if !(_twistDirection in [-1, 0, 1]) then { diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index 301333a4b4..0f9613dd9f 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -128,7 +128,7 @@ switch (_fillingType) do { } else { private _pos = _building select 0; private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); - LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); @@ -177,7 +177,7 @@ switch (_fillingType) do { } else { private _pos = _building select 0; private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); - LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); @@ -224,7 +224,7 @@ switch (_fillingType) do { } else { private _pos = selectRandom _building; private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); - LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); @@ -258,7 +258,7 @@ switch (_fillingType) do { }; }; -TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport); +TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)],_teleport); // Update the unit list and remove duplicate positions and units private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; @@ -279,5 +279,5 @@ if (_teleport) then { [_unitMoveList] call FUNC(garrisonMove); }; -TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray); +TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left",count _unitsArray,count _buildingsIndex)],_unitsArray); _unitsArray diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf index 588ebb2016..4d1c471a0e 100644 --- a/addons/ai/functions/fnc_garrisonMove.sqf +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -81,13 +81,13 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { [QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent; }; - LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]); + LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left",count _unitMoveList)]); }; // Check if unit is alive or even existing if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then { _unitMoveList deleteAt (_unitMoveList find _x); - LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left", count _unitMoveList)]); + LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left",count _unitMoveList)]); } else { private _unitPos = getPos _unit; diff --git a/addons/ai/functions/fnc_unGarrison.sqf b/addons/ai/functions/fnc_unGarrison.sqf index ab0c525a24..09ebc3e63d 100644 --- a/addons/ai/functions/fnc_unGarrison.sqf +++ b/addons/ai/functions/fnc_unGarrison.sqf @@ -28,7 +28,7 @@ _units = _units select {local _x}; private _leader = leader _unit; - TRACE_3("fnc_ungarrison: unit and leader",_unit , _leader, (_leader == _unit)); + TRACE_3("fnc_ungarrison: unit and leader",_unit,_leader,(_leader == _unit)); _unit setVariable [QGVAR(garrisonned), false, true]; diff --git a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf index 5c919564ce..5ffbbae825 100644 --- a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf +++ b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf @@ -29,7 +29,10 @@ private _currentLoiterRadius = waypointLoiterRadius _waypoint; private _currentLoiterType = waypointLoiterType _waypoint; // Set pos to ATL -_pos set [2, if (_currentHeight >= 50) then { _currentHeight } else { 0 }]; +_pos set [ + 2, + [0, _currentHeight] select (_currentHeight >= 50) +]; // [_group] call CBA_fnc_clearWaypoints; _waypoint = _group addWaypoint [_pos, 0]; diff --git a/addons/arsenal/XEH_postInit.sqf b/addons/arsenal/XEH_postInit.sqf index ac6283e604..33646a25d7 100644 --- a/addons/arsenal/XEH_postInit.sqf +++ b/addons/arsenal/XEH_postInit.sqf @@ -22,7 +22,8 @@ GVAR(lastSortDirectionRight) = DESCENDING; params ["_object"]; // If the arsenal is already open, refresh arsenal display - if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object}) then { + // Deliberate == check, fail on objNull + if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object}) then { [true, true] call FUNC(refresh); }; }] call CBA_fnc_addEventHandler; diff --git a/addons/arsenal/functions/fnc_addAction.sqf b/addons/arsenal/functions/fnc_addAction.sqf index 4606be5abe..9f69d2d51f 100644 --- a/addons/arsenal/functions/fnc_addAction.sqf +++ b/addons/arsenal/functions/fnc_addAction.sqf @@ -38,13 +38,13 @@ call FUNC(compileActions); // Skip if not allowed in editor and in editor if (is3DEN && {_scopeEditor != 2}) exitWith { - TRACE_1("Skipping action because in editor", _rootClass); + TRACE_1("Skipping action because in editor",_rootClass); [] }; // Class can't contain ~, because it's used for formatting result if ("~" in _rootClass) exitWith { - TRACE_1("Classname can't contain '~'", _rootClass); + TRACE_1("Classname can't contain '~'",_rootClass); [] }; @@ -65,7 +65,7 @@ private _fnc_addToGroup = { // Don't allow two of the same class if (_group findIf {(_x select 0) == _class} != -1) then { - TRACE_1("An action with this ID already exists", _class); + TRACE_1("An action with this ID already exists",_class); continue; }; diff --git a/addons/arsenal/functions/fnc_addSort.sqf b/addons/arsenal/functions/fnc_addSort.sqf index 053f2ff52f..767660402f 100644 --- a/addons/arsenal/functions/fnc_addSort.sqf +++ b/addons/arsenal/functions/fnc_addSort.sqf @@ -72,7 +72,7 @@ private _fnc_addToTabs = { _currentTab pushBack _sort; _return pushBack _sortName; } else { - TRACE_1("A sort with this ID already exists", _sortName); + TRACE_1("A sort with this ID already exists",_sortName); }; } forEach _tabsToAddTo; }; diff --git a/addons/arsenal/functions/fnc_addStat.sqf b/addons/arsenal/functions/fnc_addStat.sqf index 98dfe45213..d618b96a93 100644 --- a/addons/arsenal/functions/fnc_addStat.sqf +++ b/addons/arsenal/functions/fnc_addStat.sqf @@ -77,7 +77,7 @@ private _fnc_addToTabs = { // Find if there is an entry with same ID if (_currentTab findIf {_x select 5 == _statName} != -1) then { - TRACE_1("A stat with this ID already exists", _statName); + TRACE_1("A stat with this ID already exists",_statName); } else { _stat = +_finalArray; _stat set [5, _statName]; @@ -109,11 +109,10 @@ private _tabToChange = []; { _x params ["_tab", "_tabSide"]; - _tabToChange = if (_tabSide == "R") then { + _tabToChange = [ + GVAR(statsListLeftPanel), GVAR(statsListRightPanel) - } else { - GVAR(statsListLeftPanel) - }; + ] select (_tabSide == "R"); _stats = _tabToChange select _tab; diff --git a/addons/arsenal/functions/fnc_buttonActionsPage.sqf b/addons/arsenal/functions/fnc_buttonActionsPage.sqf index d135cc6a80..b3a46a68e3 100644 --- a/addons/arsenal/functions/fnc_buttonActionsPage.sqf +++ b/addons/arsenal/functions/fnc_buttonActionsPage.sqf @@ -17,7 +17,7 @@ params ["_display", "_control", "_nextPage"]; -TRACE_1("control enabled", ctrlEnabled _control); +TRACE_1("control enabled",ctrlEnabled _control); if !(ctrlEnabled _control) exitWith {}; GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage); diff --git a/addons/arsenal/functions/fnc_buttonStatsPage.sqf b/addons/arsenal/functions/fnc_buttonStatsPage.sqf index a03aa6958a..33eec398e9 100644 --- a/addons/arsenal/functions/fnc_buttonStatsPage.sqf +++ b/addons/arsenal/functions/fnc_buttonStatsPage.sqf @@ -17,7 +17,7 @@ params ["_display", "_control", "_nextPage"]; -TRACE_1("control enabled", ctrlEnabled _control); +TRACE_1("control enabled",ctrlEnabled _control); if !(ctrlEnabled _control) exitWith {}; GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage); diff --git a/addons/arsenal/functions/fnc_compileStats.sqf b/addons/arsenal/functions/fnc_compileStats.sqf index ef8cba2f40..f19854793a 100644 --- a/addons/arsenal/functions/fnc_compileStats.sqf +++ b/addons/arsenal/functions/fnc_compileStats.sqf @@ -101,7 +101,7 @@ private _priority = 0; (_finalArray select 4) set [1, compile (getText (_x >> "textStatement"))]; }; - TRACE_3("stats array", _finalArray, _leftTabsList, _rightTabsList); + TRACE_3("stats array",_finalArray,_leftTabsList,_rightTabsList); if (_leftTabsList isNotEqualTo []) then { [_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs; diff --git a/addons/arsenal/functions/fnc_fillLeftPanel.sqf b/addons/arsenal/functions/fnc_fillLeftPanel.sqf index effcc03d20..26f872dfdf 100644 --- a/addons/arsenal/functions/fnc_fillLeftPanel.sqf +++ b/addons/arsenal/functions/fnc_fillLeftPanel.sqf @@ -196,7 +196,7 @@ private _selectedItem = switch (true) do { _lbAdd = _ctrlPanel lbAdd _displayName; _ctrlPanel lbSetData [_lbAdd, _x]; _ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]]; - _ctrlPanel lbSetPictureRight [_lbAdd, _modPicture]; + _ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)]; } forEach (uiNamespace getVariable QGVAR(faceCache)); GVAR(currentFace) diff --git a/addons/arsenal/functions/fnc_fillRightPanel.sqf b/addons/arsenal/functions/fnc_fillRightPanel.sqf index 346e07fa59..09f986708d 100644 --- a/addons/arsenal/functions/fnc_fillRightPanel.sqf +++ b/addons/arsenal/functions/fnc_fillRightPanel.sqf @@ -87,7 +87,7 @@ private _fnc_fillRightContainer = { _ctrlPanel lnbSetText [[_lbAdd, 1], _displayName]; _ctrlPanel lnbSetData [[_lbAdd, 0], _className]; _ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture]; - _ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique]; + _ctrlPanel lnbSetValue [[_lbAdd, 2], parseNumber _isUnique]; _ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]]; if ((toLower _className) in GVAR(favorites)) then { _ctrlPanel lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR]; diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 24fbd624f6..4d62075f78 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -147,7 +147,7 @@ if (!isNull _loadoutsDisplay) then { // Right panel lnb + and - buttons case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { if (GVAR(rightTabLnBFocus)) then { - [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); + [_display, parseNumber (_keyPressed != DIK_LEFT)] call FUNC(buttonCargo); }; }; }; diff --git a/addons/arsenal/functions/fnc_refresh.sqf b/addons/arsenal/functions/fnc_refresh.sqf index d40d59c0ff..849b49d16b 100644 --- a/addons/arsenal/functions/fnc_refresh.sqf +++ b/addons/arsenal/functions/fnc_refresh.sqf @@ -25,6 +25,11 @@ if (canSuspend) exitWith { [{_this call FUNC(refresh)}, _this] call CBA_fnc_directCall; }; +private _display = findDisplay IDD_ace_arsenal; + +// Exit quietly if no display found +if (isNull _display) exitWith {}; + if (_updateItems) then { // Update current item list call FUNC(updateCurrentItemsList); @@ -65,6 +70,4 @@ if (!_animate) then { [{GVAR(refreshing) = false}, nil, 3] call CBA_fnc_execAfterNFrames; }; -private _display = findDisplay IDD_ace_arsenal; - [_display, _display displayCtrl GVAR(currentLeftPanel), _animate] call FUNC(fillLeftPanel); diff --git a/addons/arsenal/functions/fnc_removeBox.sqf b/addons/arsenal/functions/fnc_removeBox.sqf index 984db8d099..9fa3ec377a 100644 --- a/addons/arsenal/functions/fnc_removeBox.sqf +++ b/addons/arsenal/functions/fnc_removeBox.sqf @@ -42,8 +42,14 @@ if (_global && {isMultiplayer} && {!isNil "_id"}) then { }; // If the arsenal is already open and not ignoring content (see FUNC(openBox)), close arsenal display -if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object} && {isNil QGVAR(ignoredVirtualItems)}) then { - [LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText); - // Delay a frame in case this is running on display open - [{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame; +// Deliberate == check, fail on objNull +if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object} && {isNil QGVAR(ignoredVirtualItems)}) then { + // Delay a frame in case this is running on display open/close + [{ + private _display = findDisplay IDD_ace_arsenal; + if (isNull _display) exitWith {}; + + [LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText); + _display closeDisplay 0; + }] call CBA_fnc_execNextFrame; }; diff --git a/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf b/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf index b677ec8210..3f982f575c 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf @@ -31,9 +31,9 @@ if (_allItems isEqualTo []) then { _allItems = [configName _config] }; || {_illum && {([_xCfg >> "Flashlight" >> "irLight", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1}}; private _text = switch (true) do { // shorthand roughly based on PEQ-15 - case (_laser && _illum): { if (_isIR) then { "IR-DUAL" } else { "VIS-DUAL" } }; - case (_laser): { if (_isIR) then { "IR-AIM" } else { "VIS-AIM" } }; // AIM - case (_illum): { if (_isIR) then { "IR-ILM" } else { "VIS-ILM" } }; // ILLUMIATION + case (_laser && _illum): { ["VIS-DUAL", "IR-DUAL"] select _isIR }; // DUAL + case (_laser): { ["VIS-AIM", "IR-AIM"] select _isIR }; // AIM + case (_illum): { ["VIS-ILM", "IR-ILM"] select _isIR }; // ILLUMIATION default { "_" }; // there are some purely cosmetic attachements }; _allModes pushBackUnique _text; diff --git a/addons/arsenal/functions/fnc_verifyLoadout.sqf b/addons/arsenal/functions/fnc_verifyLoadout.sqf index b5425c2117..adc76f391a 100644 --- a/addons/arsenal/functions/fnc_verifyLoadout.sqf +++ b/addons/arsenal/functions/fnc_verifyLoadout.sqf @@ -46,11 +46,7 @@ private _fnc_toConfigCase = { // If item doesn't exist in config, "" is returned // Just return unaltered item name in that case, so it can be documented as being unavailable - if (_name != "") then { - _name - } else { - _x - }; + [_x, _name] select (_name != ""); } else { _x }; diff --git a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf index 97c8dfe435..327a2903a0 100644 --- a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf @@ -65,7 +65,7 @@ GVAR(magModeData) = []; { _x params ["_xDisplayNameShort", "_xDisplayName", "_xInitSpeed", "_xAirFriction"]; if (_allSameCharge) then { - _ctrlChargeList lbAdd format ["%1", _xDisplayNameShort]; + _ctrlChargeList lbAdd _xDisplayNameShort; _ctrlChargeList lbSetTooltip [count GVAR(magModeData), format ["%1\n%2 m/s\n%3", _xDisplayName, _xInitSpeed toFixed 1, _xAirFriction]]; GVAR(magModeData) pushBack [_xInitSpeed, _xAirFriction]; } else { diff --git a/addons/atragmx/functions/fnc_initGunList.sqf b/addons/atragmx/functions/fnc_initGunList.sqf index 783a68202a..2ae67bb78d 100644 --- a/addons/atragmx/functions/fnc_initGunList.sqf +++ b/addons/atragmx/functions/fnc_initGunList.sqf @@ -15,7 +15,7 @@ * Public: No */ -LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]", profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion), 'none')], count (profileNamespace getVariable [ARR_2(QGVAR(gunList), [])])); +LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]",profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion),'none')],count (profileNamespace getVariable [ARR_2(QGVAR(gunList),[])])); private _resetGunList = true; if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && {count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0}) then { diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index 4def2f87a6..cfd8f460a9 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -90,7 +90,7 @@ if (GVAR(showWind2)) then { _elevationAbs = Round(_elevationAbs * 100) / 100; if (_elevationAbs > 0) then { - ctrlSetText [400, format["%1", abs(_elevationAbs)]]; + ctrlSetText [400, str abs _elevationAbs]; } else { if (_elevationAbs < 0) then { ctrlSetText [400, format["%1D", abs(_elevationAbs)]]; @@ -100,7 +100,7 @@ if (_elevationAbs > 0) then { }; _elevationRel = Round(_elevationRel * 100) / 100; if (_elevationRel > 0) then { - ctrlSetText [401, format["%1", abs(_elevationRel)]]; + ctrlSetText [401, str abs _elevationRel]; } else { if (_elevationRel < 0) then { ctrlSetText [401, format["%1D", abs(_elevationRel)]]; @@ -110,7 +110,7 @@ if (_elevationRel > 0) then { }; _elevationCur = Round(_elevationCur * 100) / 100; if (_elevationCur > 0) then { - ctrlSetText [402, format["%1", abs(_elevationCur)]]; + ctrlSetText [402, str abs _elevationCur]; } else { if (_elevationCur < 0) then { ctrlSetText [402, format["%1D", abs(_elevationCur)]]; diff --git a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf index 4341867b29..2e07a353df 100644 --- a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf +++ b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf @@ -16,7 +16,7 @@ */ params ["_vehicle"]; -TRACE_1("params", _vehicle); +TRACE_1("params",_vehicle); scopeName "main"; diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index a8522ad283..734fe99c39 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -44,7 +44,7 @@ if (_item getVariable [QGVAR(initObject),false]) exitWith {}; if (_canLoadConfig) then { GVAR(initializedItemClasses) pushBack _type; - TRACE_1("Adding load cargo action to class", _type); + TRACE_1("Adding load cargo action to class",_type); { [_type, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToClass); @@ -52,7 +52,7 @@ if (_canLoadConfig) then { } else { _item setVariable [QGVAR(initObject), true]; - TRACE_1("Adding load cargo action to object", _item); + TRACE_1("Adding load cargo action to object",_item); { [_item, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToObject); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index ed0a02cba9..3361897e50 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -16,7 +16,7 @@ */ params ["_vehicle"]; -TRACE_1("params", _vehicle); +TRACE_1("params",_vehicle); private _type = typeOf _vehicle; private _config = configOf _vehicle; @@ -68,13 +68,13 @@ if (_type in GVAR(initializedVehicleClasses)) exitWith {}; if (_hasCargoConfig) then { GVAR(initializedVehicleClasses) pushBack _type; - TRACE_1("Adding unload cargo action to class", _type); + TRACE_1("Adding unload cargo action to class",_type); [_type, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass); } else { _vehicle setVariable [QGVAR(initVehicle), true]; - TRACE_1("Adding unload cargo action to object", _vehicle); + TRACE_1("Adding unload cargo action to object",_vehicle); [_vehicle, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToObject); }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index c703591344..af4b33d49b 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -96,7 +96,7 @@ _object setVariable ["acre_sys_core_isDisabled", _set > 0, true]; }; if (["task_force_radio"] call FUNC(isModLoaded)) then { - _object setVariable ["tf_voiceVolume", [1, 0] select (_set > 0), true]; + _object setVariable ["tf_voiceVolume", parseNumber (_set == 0), true]; }; }] call CBA_fnc_addEventHandler; @@ -142,7 +142,7 @@ if (isServer) then { if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then { { if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith { - INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x); + INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x); _x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true]; }; nil diff --git a/addons/common/XEH_preStart.sqf b/addons/common/XEH_preStart.sqf index b872756af8..208adea7b1 100644 --- a/addons/common/XEH_preStart.sqf +++ b/addons/common/XEH_preStart.sqf @@ -5,7 +5,7 @@ if (isFilePatchingEnabled) then { private _notLoaded = configProperties [configfile >> "ace_notLoaded", "isText _x"]; { - INFO_2("%1 not loaded because %2",configName _x, getText _x); + INFO_2("%1 not loaded because %2",configName _x,getText _x); } forEach _notLoaded; }; diff --git a/addons/common/dev/test_cfgPatches.sqf b/addons/common/dev/test_cfgPatches.sqf index bd00869360..281c16eca3 100644 --- a/addons/common/dev/test_cfgPatches.sqf +++ b/addons/common/dev/test_cfgPatches.sqf @@ -18,11 +18,11 @@ private _allUnits = []; { private _class = configFile >> "CfgVehicles" >> _x; if (isNull _class) then { - WARNING_1("in units[] but null - %1", _x); + WARNING_1("in units[] but null - %1",_x); _testPass = false; } else { // if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then { - // WARNING_2("in units[] but not public - %1 from %2", configName _class, configSourceMod _class); + // WARNING_2("in units[] but not public - %1 from %2",configName _class,configSourceMod _class); // _testPass = false; // }; }; @@ -36,11 +36,11 @@ private _allWeapons = []; { private _class = configFile >> "CfgWeapons" >> _x; if (isNull _class) then { - WARNING_1("in weapons[] but null - %1", _x); + WARNING_1("in weapons[] but null - %1",_x); _testPass = false; } else { // if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then { - // WARNING_2("in weapons[] but not public - %1 from %2", configName _class, configSourceMod _class); + // WARNING_2("in weapons[] but not public - %1 from %2",configName _class,configSourceMod _class); // _testPass = false; // }; }; @@ -51,7 +51,7 @@ private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFil { if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then { if (!((toLower configName _x) in _allUnits)) then { - WARNING_2("Not in any units[] - %1 from %2", configName _x, configSourceMod _x); + WARNING_2("Not in any units[] - %1 from %2",configName _x,configSourceMod _x); _testPass = false; }; }; @@ -63,7 +63,7 @@ private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (config private _type = toLower configName _x; if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then { if (!((toLower configName _x) in _allWeapons)) then { - WARNING_2("Not in any weapons[] - %1 from %2", configName _x, configSourceMod _x); + WARNING_2("Not in any weapons[] - %1 from %2",configName _x,configSourceMod _x); _testPass = false; }; }; diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index a5bb286768..299dff8373 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -27,7 +27,7 @@ if (isServer) then { params ["_eventName", "_client"]; if !(_eventName in GVAR(syncedEvents)) exitWith { - ERROR_1("Request for synced event - key [%1] not found.", _eventName); + ERROR_1("Request for synced event - key [%1] not found.",_eventName); false }; diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index a7b28de1a6..aac8ac873e 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -20,7 +20,7 @@ params ["_name", "_args", "_ttl"]; if !(_name in GVAR(syncedEvents)) exitWith { - ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name); + ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).",_name); false }; diff --git a/addons/common/functions/fnc_cbaSettings_convertHelper.sqf b/addons/common/functions/fnc_cbaSettings_convertHelper.sqf index 4597cf3d40..b7ef446cf6 100644 --- a/addons/common/functions/fnc_cbaSettings_convertHelper.sqf +++ b/addons/common/functions/fnc_cbaSettings_convertHelper.sqf @@ -22,7 +22,7 @@ private _output = [format ["// CBA Settings [ADDON: %1]:", _addon]]; private _addonSearch = _addon + "_"; private _addonSearchCount = count _addonSearch; -TRACE_2("",_addonSearch, _addonSearchCount); +TRACE_2("",_addonSearch,_addonSearchCount); private _settings = configProperties [configFile >> "ACE_Settings", "(isClass _x) && {((configName _x) select [0, _addonSearchCount]) == _addonSearch}"]; diff --git a/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf b/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf index eaa9d089fc..8b6e62cbf6 100644 --- a/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf +++ b/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf @@ -34,7 +34,7 @@ private _aceSettings = configProperties [configFile >> "ACE_Settings", "isClass if (_isClientSettable && {_currentValue isNotEqualTo _profileVar}) then { // CBA_settings_fnc_set will do type checking for the old profile var private _ret = [_settingName, _profileVar, 0, "client", true] call CBA_settings_fnc_set; - INFO_3("Transfering setting [%1: %2] returned %3", _settingName, _profileVar, _ret); + INFO_3("Transfering setting [%1: %2] returned %3",_settingName,_profileVar,_ret); }; }; } forEach _aceSettings; diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 8b00cad533..47de2290dd 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -80,7 +80,7 @@ if (_oldCompats isNotEqualTo []) then { _oldCompats = _oldCompats apply {format ["%1 (%2)", _x select 0, _x select 1]}; [{ // Lasts for ~10 seconds - ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated", "%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2); + ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated","%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2); }, [_oldCompats, _mainVersion, _mainSource], 1] call CBA_fnc_waitAndExecute; }; diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 6c58954b13..3774a3fc29 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -219,7 +219,7 @@ if (_state) then { _keyPressedInfo set [1, ((_keyPressedInfo select 1) - 1) max 0]; if (_keyPressedInfo isEqualTo [false, 0]) then { - GVAR(keyboardInputMain) deleteAt _key, + GVAR(keyboardInputMain) deleteAt _key; }; }, _key, 0.5] call CBA_fnc_waitAndExecute; }]; diff --git a/addons/common/functions/fnc_firedEH.sqf b/addons/common/functions/fnc_firedEH.sqf index 9a4c8e50d6..cee874782a 100644 --- a/addons/common/functions/fnc_firedEH.sqf +++ b/addons/common/functions/fnc_firedEH.sqf @@ -24,7 +24,7 @@ BEGIN_COUNTER(firedEH); params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; -TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile); +TRACE_7("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if (_unit isKindOf "CAManBase") then { // The unit it on foot diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 2b92e6ef10..4d2e53d3da 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -27,7 +27,7 @@ if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState} private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions"); -TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg); +TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg); if (vehicle _unit != _unit) then { private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index 6f24b40f3e..7592bc8f33 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -25,7 +25,7 @@ private _pov = getText (_turret >> "memoryPointGunnerOptics"); private _gunBeg = getText (_turret >> "gunBeg"); private _gunEnd = getText (_turret >> "gunEnd"); -TRACE_3("", _pov, _gunBeg, _gunEnd); +TRACE_3("",_pov,_gunBeg,_gunEnd); // Pull the PIP pov or barrel direction, depending on how the model is set up private _povPos = _vehicle modelToWorldVisualWorld (_vehicle selectionPosition _pov); diff --git a/addons/common/functions/fnc_getWeight.sqf b/addons/common/functions/fnc_getWeight.sqf index 8e048431c9..300a74d382 100644 --- a/addons/common/functions/fnc_getWeight.sqf +++ b/addons/common/functions/fnc_getWeight.sqf @@ -5,10 +5,10 @@ * * Arguments: * 0: The Unit (usually the player) - * 1: Force a return type + * 1: Return imperial units * * Return Value: - * The return value + * Weight string * * Example: * [player] call ace_common_fnc_getWeight diff --git a/addons/common/functions/fnc_playConfigSound3D.sqf b/addons/common/functions/fnc_playConfigSound3D.sqf index c282199365..788a2a6b4e 100644 --- a/addons/common/functions/fnc_playConfigSound3D.sqf +++ b/addons/common/functions/fnc_playConfigSound3D.sqf @@ -22,7 +22,7 @@ params ["_soundClass", "_posASL", "_volume", "_distance"]; private _sound = getArray (configFile >> "CfgSounds" >> _soundClass >> "sound"); if (_sound isEqualTo []) exitWith { - ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array", _soundClass); + ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array",_soundClass); }; TRACE_2("sound",_soundClass,_sound); diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index dc9ead397f..5f9678f97b 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -23,7 +23,7 @@ params ["_logic", "_settingName", "_moduleVariable"]; // Check if the variable is already defined if (isNil _settingName) exitWith { - ERROR_1("readSettingFromModule - param [%1] is not an ace_setting", _settingName); + ERROR_1("readSettingFromModule - param [%1] is not an ace_setting",_settingName); }; // Check if the parameter is defined in the module diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf index 2abb5fa73e..7273fc61ca 100644 --- a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -32,7 +32,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); // Check if the variable is already defined if (isNil _settingName) exitWith { - ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName); + ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting",_settingName); }; // The setting is not forced, so update the value @@ -52,7 +52,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); }; if (!_validValue) exitWith { - WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_settingType); + WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]",_settingName,_settingValue,_settingType); }; if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then { diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index 6c45fb8966..02a9379e6c 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -31,7 +31,7 @@ if (isLocalized _requestMessage) then { _requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)]; }; -hint format ["%1", _requestMessage]; // @todo ? +hint str _requestMessage; // @todo ? if (!isNil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then { terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT); diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 5aed6270f4..615f50ce49 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -18,7 +18,7 @@ params ["_name"]; if !(_name in GVAR(syncedEvents)) exitWith { - ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name); + ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler)",_name); false }; diff --git a/addons/common/functions/fnc_runTests.sqf b/addons/common/functions/fnc_runTests.sqf index 946255c42f..4a449fb7eb 100644 --- a/addons/common/functions/fnc_runTests.sqf +++ b/addons/common/functions/fnc_runTests.sqf @@ -22,7 +22,7 @@ private _startTime = diag_tickTime; private _fails = []; private _total = 0; -INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest); +INFO_1("ace_common_fnc_runTests starting for [%1]",_specificTest); { private _testName = configName _x; @@ -41,8 +41,8 @@ INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest); }; } forEach (configProperties [configFile >> "ACE_Tests"]); -INFO_1("ace_common_fnc_runTests finished in %1 ms", (1000 * (diag_tickTime - _startTime)) toFixed 1); -INFO_2("[%1 / %2] Tests Passed", (_total - (count _fails)), _total); +INFO_1("ace_common_fnc_runTests finished in %1 ms",(1000 * (diag_tickTime - _startTime)) toFixed 1); +INFO_2("[%1 / %2] Tests Passed",(_total - (count _fails)),_total); if (_fails isNotEqualTo []) then { - INFO_1("Failed: %1", _fails); + INFO_1("Failed: %1",_fails); }; diff --git a/addons/common/functions/fnc_setApproximateVariablePublic.sqf b/addons/common/functions/fnc_setApproximateVariablePublic.sqf index 3ef9595121..ebd4476de5 100644 --- a/addons/common/functions/fnc_setApproximateVariablePublic.sqf +++ b/addons/common/functions/fnc_setApproximateVariablePublic.sqf @@ -38,4 +38,4 @@ if (abs(_value - _oldValue) < _tolerance) exitWith {}; _object setVariable [_varName, _value, true]; _object setVariable [_oldVarName, _value]; -TRACE_2("Published variable:", _varName, _value); +TRACE_2("Published variable:",_varName,_value); diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 8b583849be..678e2bc057 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -34,7 +34,7 @@ if (_object isEqualTo (_object getVariable [format ["ACE_onEmbargo_%1", _varName _object setVariable [_varName, _value, true]; _object setVariable [format ["ACE_onEmbargo_%1", _varName], _object]; -TRACE_2("Starting Embargo", _varName, _delay); +TRACE_2("Starting Embargo",_varName,_delay); [{ params ["_object", "_varName", "_value"]; @@ -43,7 +43,7 @@ TRACE_2("Starting Embargo", _varName, _delay); _object setVariable [format ["ACE_onEmbargo_%1", _varName], nil]; //Remove Embargo private _curValue = _object getVariable _varName; - TRACE_4("End of embargo", _object, _varName, _value, _curValue); + TRACE_4("End of embargo",_object,_varName,_value,_curValue); //If value at start of embargo doesn't equal current, then broadcast and start new embargo if (_value isNotEqualTo _curValue) then { diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index da6f2e0975..1ca7ca8106 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -41,11 +41,11 @@ if (isArray (missionConfigFile >> "showHUD")) then { if (_reason != "") then { _reason = toLower _reason; if (_mask isEqualTo []) then { - TRACE_2("Removing", _reason, _mask); + TRACE_2("Removing",_reason,_mask); GVAR(showHudHash) deleteAt _reason; } else { while {(count _mask) < 10} do { _mask pushBack true; }; - TRACE_2("Setting", _reason, _mask); + TRACE_2("Setting",_reason,_mask); GVAR(showHudHash) set [_reason, _mask]; }; }; @@ -63,7 +63,7 @@ for "_index" from 0 to 9 do { _resultMask pushBack _set; }; -TRACE_2("showHud", _resultMask, keys GVAR(showHudHash)); +TRACE_2("showHud",_resultMask,keys GVAR(showHudHash)); showHud _resultMask; _resultMask diff --git a/addons/common/functions/fnc_statusEffect_addType.sqf b/addons/common/functions/fnc_statusEffect_addType.sqf index 44b39b10c9..c7bd61762e 100644 --- a/addons/common/functions/fnc_statusEffect_addType.sqf +++ b/addons/common/functions/fnc_statusEffect_addType.sqf @@ -21,8 +21,8 @@ params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]], ["_sendJIP", false, [false]]]; TRACE_3("params",_name,_isGlobal,_commonReasonsArray); -if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1", _this)}; -if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1", _this)}; +if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1",_this)}; +if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1",_this)}; if (_sendJIP && !_isGlobal) exitWith {WARNING_1("addStatusEffect - Trying to add non-global JIP effect %1",_this)}; GVAR(statusEffect_Names) pushBack _name; diff --git a/addons/common/functions/fnc_statusEffect_localEH.sqf b/addons/common/functions/fnc_statusEffect_localEH.sqf index f8ff93dba7..e60679350d 100644 --- a/addons/common/functions/fnc_statusEffect_localEH.sqf +++ b/addons/common/functions/fnc_statusEffect_localEH.sqf @@ -22,12 +22,12 @@ TRACE_2("params",_object,_isLocal); //Only run this after the settings are initialized //Need to wait for all EH to be installed (local event will happen between pre and post init) if !(GVAR(settingsInitFinished)) exitWith { - TRACE_1("pushing to runAtSettingsInitialized", _this); + TRACE_1("pushing to runAtSettingsInitialized",_this); GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_localEH), _this]; }; -if (!_isLocal) exitWith {TRACE_1("object no longer local", _this)}; -if (isNull _object) exitWith {TRACE_1("object null", _this)}; +if (!_isLocal) exitWith {TRACE_1("object no longer local",_this)}; +if (isNull _object) exitWith {TRACE_1("object null",_this)}; //Reset any variables because of respawn [_object, false] call FUNC(statusEffect_resetVariables); diff --git a/addons/common/functions/fnc_statusEffect_respawnEH.sqf b/addons/common/functions/fnc_statusEffect_respawnEH.sqf index 2c4a4840fe..edad032a9a 100644 --- a/addons/common/functions/fnc_statusEffect_respawnEH.sqf +++ b/addons/common/functions/fnc_statusEffect_respawnEH.sqf @@ -21,12 +21,12 @@ TRACE_1("params",_object); //Only run this after the settings are initialized //Need to wait for all EH to be installed (local event will happen between pre and post init) if !(GVAR(settingsInitFinished)) exitWith { - TRACE_1("pushing to runAtSettingsInitialized", _this); + TRACE_1("pushing to runAtSettingsInitialized",_this); GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_respawnEH), _this]; }; -if (!local _object) exitWith {TRACE_1("object no longer local", _this)}; -if (isNull _object) exitWith {TRACE_1("object null", _this)}; +if (!local _object) exitWith {TRACE_1("object no longer local",_this)}; +if (isNull _object) exitWith {TRACE_1("object null",_this)}; //Reset any variables on "real" respawn [_object, false] call FUNC(statusEffect_resetVariables); diff --git a/addons/common/functions/fnc_statusEffect_sendEffects.sqf b/addons/common/functions/fnc_statusEffect_sendEffects.sqf index bae2807782..a4e3f2d2a4 100644 --- a/addons/common/functions/fnc_statusEffect_sendEffects.sqf +++ b/addons/common/functions/fnc_statusEffect_sendEffects.sqf @@ -32,17 +32,17 @@ if (isNull _object) exitWith {}; private _eventName = format [QGVAR(%1), _x]; switch (true) do { case (GVAR(statusEffect_sendJIP) select _forEachIndex): { - TRACE_2("Sending Global JIP Event", _object, _effectNumber); + TRACE_2("Sending Global JIP Event",_object,_effectNumber); private _jipID = format [QGVAR(effect_%1_%2), _eventName, hashValue _object]; [_eventName, [_object, _effectNumber], _jipID] call CBA_fnc_globalEventJIP; [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; }; case (GVAR(statusEffect_isGlobal) select _forEachIndex): { - TRACE_2("Sending Global Event", _object, _effectNumber); + TRACE_2("Sending Global Event",_object,_effectNumber); [_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent; }; default { - TRACE_2("Sending Target Event", _object, _effectNumber); + TRACE_2("Sending Target Event",_object,_effectNumber); [_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent; }; }; diff --git a/addons/common/functions/fnc_statusEffect_set.sqf b/addons/common/functions/fnc_statusEffect_set.sqf index 48af4bf771..6e8a74bd3e 100644 --- a/addons/common/functions/fnc_statusEffect_set.sqf +++ b/addons/common/functions/fnc_statusEffect_set.sqf @@ -23,7 +23,7 @@ TRACE_4("params",_object,_effectName,_ID,_set); //Only run this after the settings are initialized if !(GVAR(settingsInitFinished)) exitWith { - TRACE_1("pushing to runAtSettingsInitialized", _this); + TRACE_1("pushing to runAtSettingsInitialized",_this); GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_set), _this]; }; diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 5bcb678524..75170fe7d1 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -20,7 +20,7 @@ params ["_name", "_args", ["_ttl", 0]]; if !(_name in GVAR(syncedEvents)) exitWith { - ERROR_1("Synced event key [%1] not found (syncedEvent).", _name); + ERROR_1("Synced event key [%1] not found (syncedEvent)",_name); false }; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index d7a2f57db0..0378c6a4b8 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -35,7 +35,7 @@ if (_emptyPos isEqualTo []) then { }; if (count _emptyPos != 3) exitwith { - WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle, getPosASL _vehicle, isTouchingGround _vehicle, speed _vehicle); + WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle); if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then { //display text saying there are no safe places to exit the vehicle [QGVAR(displayTextStructured), [localize LSTRING(NoRoomToUnload)], [_unloader]] call CBA_fnc_targetEvent; diff --git a/addons/compat_cup_terrains/$PBOPREFIX$ b/addons/compat_cup_terrains/$PBOPREFIX$ new file mode 100644 index 0000000000..f904236cf3 --- /dev/null +++ b/addons/compat_cup_terrains/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup_terrains diff --git a/addons/compat_cup_terrains/CfgEventHandlers.hpp b/addons/compat_cup_terrains/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9cc1b0427b --- /dev/null +++ b/addons/compat_cup_terrains/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/compat_cup_terrains/CfgVehicles.hpp b/addons/compat_cup_terrains/CfgVehicles.hpp new file mode 100644 index 0000000000..08176b77fe --- /dev/null +++ b/addons/compat_cup_terrains/CfgVehicles.hpp @@ -0,0 +1,48 @@ +class CfgVehicles { + class House; + class House_Small_F; + class Strategic; + class House_EP1: House {}; + + class Land_Benzina_schnell: House { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-1.5,-3.93,-1.25}, {2.35,-3.93,-1.25}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + position = "[0,-3.93,-1.25]"; + distance = 5; + condition = "true"; + }; + }; + }; + class Land_A_FuelStation_Feed: Strategic { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class Land_Ind_FuelStation_Feed_EP1: House_EP1 { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class Land_FuelStation_Feed_PMC: Strategic { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class FuelStation: House_Small_F { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{1.25, .2, -1.1}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + position = "[1.25, .2, -1]"; + distance = 5; + condition = "true"; + }; + }; + }; +}; diff --git a/addons/compat_cup_terrains/XEH_postInit.sqf b/addons/compat_cup_terrains/XEH_postInit.sqf new file mode 100644 index 0000000000..32b9393d98 --- /dev/null +++ b/addons/compat_cup_terrains/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (["CUP_Terrains_ACE_compat"] call EFUNC(common,isModLoaded)) exitWith { + ERROR_WITH_TITLE("Duplicate CUP/ACE Compats","Compats are now part of ACE - Uninstall 'CUP ACE3 Compatibility Addon - Terrains'"); +}; diff --git a/addons/compat_cup_terrains/config.cpp b/addons/compat_cup_terrains/config.cpp new file mode 100644 index 0000000000..a7020be4da --- /dev/null +++ b/addons/compat_cup_terrains/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" +#include "\z\ace\addons\refuel\defines.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CABuildings", + "CAStructuresHouse_A_FuelStation", + "CAStructures_E_Ind_Ind_FuelStation", + "CAStructures_PMC_FuelStation", + "CUP_Buildings_Config", + "ace_refuel" // not a sub-component because it's all this compat does + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Community Upgrade Project", "Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgEventHandlers.hpp" diff --git a/addons/compat_cup_terrains/script_component.hpp b/addons/compat_cup_terrains/script_component.hpp new file mode 100644 index 0000000000..633de5584b --- /dev/null +++ b/addons/compat_cup_terrains/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_cup_terrains +#define COMPONENT_BEAUTIFIED CUP Terrains Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp index 994af4f667..4fda436d18 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp @@ -1,7 +1,14 @@ class CfgWeapons { // Last update: RHSAFRF 0.5.6 - class rhs_acc_perst3; - class rhs_acc_perst3_2dp: rhs_acc_perst3 { - baseWeapon = "rhs_acc_perst3_2dp"; + class rhs_acc_perst3_2dp_light; + class rhs_acc_perst3_2dp_light_h: rhs_acc_perst3_2dp_light { + baseWeapon = "rhs_acc_perst3_2dp_h"; + }; + + class acc_pointer_IR; + class rhs_acc_perst1ik: acc_pointer_IR { + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; }; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp index bb2e1bf3a2..b544accac3 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp @@ -15,4 +15,4 @@ class CfgPatches { }; }; -//#include "CfgWeapons.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp index 8dc735265c..b87223ae27 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp @@ -3,6 +3,9 @@ class CfgWeapons { class acc_pointer_IR; class rhsusf_acc_anpeq15: acc_pointer_IR { baseWeapon = "rhsusf_acc_anpeq15"; + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; class rhsusf_acc_anpeq15_bk: rhsusf_acc_anpeq15 { baseWeapon = "rhsusf_acc_anpeq15_bk"; @@ -28,8 +31,12 @@ class CfgWeapons { class rhsusf_acc_wmx_bk: rhsusf_acc_M952V { baseWeapon = "rhsusf_acc_wmx_bk"; }; + class rhsusf_acc_anpeq15A: acc_pointer_IR { baseWeapon = "rhsusf_acc_anpeq15A"; + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; class rhsusf_acc_anpeq15_top: rhsusf_acc_anpeq15A { baseWeapon = "rhsusf_acc_anpeq15_top"; @@ -37,8 +44,12 @@ class CfgWeapons { class rhsusf_acc_anpeq15_bk_top: rhsusf_acc_anpeq15_top { baseWeapon = "rhsusf_acc_anpeq15_bk_top"; }; + class rhsusf_acc_anpeq15side: acc_pointer_IR { baseWeapon = "rhsusf_acc_anpeq15side"; + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; class rhsusf_acc_anpeq15side_bk: rhsusf_acc_anpeq15side { baseWeapon = "rhsusf_acc_anpeq15side_bk"; diff --git a/addons/csw/dev/checkStaticWeapons.sqf b/addons/csw/dev/checkStaticWeapons.sqf index 59e712cb70..1d7ffe988d 100644 --- a/addons/csw/dev/checkStaticWeapons.sqf +++ b/addons/csw/dev/checkStaticWeapons.sqf @@ -7,7 +7,7 @@ INFO("Checking static weapons"); private _staticWeaponConfigs = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(configName _x) isKindOf 'StaticWeapon'}", true]; private _staticPublic = _staticWeaponConfigs select {(getNumber (_x >> "scope")) == 2}; -INFO_2("Static Weapons [%1] - CSW Enabled [%2]",count _staticPublic, {(getNumber (_x >> "ace_csw" >> "enabled")) == 1} count _staticPublic); +INFO_2("Static Weapons [%1] - CSW Enabled [%2]",count _staticPublic,{(getNumber (_x >> "ace_csw" >> "enabled")) == 1} count _staticPublic); INFO("------ Checking static weapons inheritance ------"); private _explicitBases = []; diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index 9a2eae2bd4..74cd9f73b5 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -24,7 +24,7 @@ params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_returnTo", _magSource]]; TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo); -TRACE_2("",local _vehicle, _vehicle turretLocal _turret); +TRACE_2("",local _vehicle,_vehicle turretLocal _turret); if (!(_vehicle turretLocal _turret)) exitWith {}; ([_vehicle, _turret, _carryMag] call FUNC(reload_canLoadMagazine)) params ["_canAdd", "_loadedMag", "_neededAmmo", "_isBeltLinking"]; @@ -43,10 +43,10 @@ if (_canAdd) then { // setMagazineTurretAmmo is broken on split locality, use setAmmo for now (this may not work for multi turret vehicles) private _weapon = (_vehicle weaponsTurret _turret) param [0, ""]; - TRACE_3("setAmmo",_vehicle,_weapon, _currentAmmo); + TRACE_3("setAmmo",_vehicle,_weapon,_currentAmmo); _vehicle setAmmo [_weapon, _currentAmmo]; private _currentAmmo = _vehicle magazineTurretAmmo [_loadedMag, _turret]; - if ((_weapon == "") || {_currentAmmo != _currentAmmo}) then { ERROR_1("failed to setAmmo - %1", _this); }; + if ((_weapon == "") || {_currentAmmo != _currentAmmo}) then { ERROR_1("failed to setAmmo - %1",_this); }; } else { if (_loadedMag != "") then { TRACE_1("Removing emtpy mag",_loadedMag); diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index d53d35a0d8..d718811d55 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -23,7 +23,7 @@ params ["_vehicle", "_turretPath", "_carryMag", "_vehMag", "_unloadTo"]; TRACE_5("removeTurretMag EH",_vehicle,_turretPath,_carryMag,_vehMag,_unloadTo); -TRACE_3("",local _vehicle, _vehicle turretLocal _turretPath,local _unloadTo); +TRACE_3("",local _vehicle,_vehicle turretLocal _turretPath,local _unloadTo); if (!(_vehicle turretLocal _turretPath)) exitWith {}; private _magsInWeapon = []; // Check how much ammo it has now: @@ -55,10 +55,10 @@ if ((_magsInWeapon isEqualTo []) && {_ammoInFirstMag > _ammoRemoved}) then { // setMagazineTurretAmmo is broken on split locality, use setAmmo for now private _weapon = (_vehicle weaponsTurret _turretPath) param [0, ""]; - TRACE_3("setAmmo",_vehicle,_weapon, _ammoLeft); + TRACE_3("setAmmo",_vehicle,_weapon,_ammoLeft); _vehicle setAmmo [_weapon, _ammoLeft]; private _currentAmmo = _vehicle magazineTurretAmmo [_vehMag, _turretPath]; - if ((_weapon == "") || {_currentAmmo != _ammoLeft}) then { ERROR_1("failed to setAmmo - %1", _this); }; + if ((_weapon == "") || {_currentAmmo != _ammoLeft}) then { ERROR_1("failed to setAmmo - %1",_this); }; } else { diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 42508daf1d..9526b5adb8 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -51,7 +51,7 @@ private _onFinish = { [_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); if (_bestAmmoToSend == 0) exitWith {}; - TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend, _unit); + TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend,_unit); [QGVAR(addTurretMag), [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend, _unit]] call CBA_fnc_globalEvent; }; diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index 5bc757e295..fc05185638 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -541,7 +541,7 @@ GVAR(menuRun) = true; }; case "options": { (__dsp displayCtrl __Option0) ctrlSetText "Signal Delay"; - (__dsp displayCtrl __Option1) ctrlSetText (if (GVAR(useDegrees)) then { "Direction: Deg" } else { "Direction: MIL" }); + (__dsp displayCtrl __Option1) ctrlSetText (["Direction: MIL", "Direction: Deg"] select GVAR(useDegrees)); (__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QPATHTOF(UI\DAGR_Selection.paa); if (GVAR(SEL)) then { GVAR(vectorConnected) = false; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index 21e19ff023..b7064ce248 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -65,10 +65,10 @@ GVAR(outputPFH) = [{ private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; // Output - __gridControl ctrlSetText format ["%1", _dagrGrid]; - __speedControl ctrlSetText format ["%1", _dagrSpeed]; - __elevationControl ctrlSetText format ["%1", _dagrElevation]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 �", _dagrHeading] }); - __timeControl ctrlSetText format ["%1", _dagrTime]; + __gridControl ctrlSetText _dagrGrid; + __speedControl ctrlSetText _dagrSpeed; + __elevationControl ctrlSetText _dagrElevation; + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _dagrHeading } else { format ["%1 �", _dagrHeading] }); + __timeControl ctrlSetText _dagrTime; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index 5eb1b9bffa..e9bd0ea6c3 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -89,8 +89,8 @@ private _dagrDist = str GVAR(LAZDIST) + "m"; GVAR(vectorGrid) = _dagrGrid; // OUTPUT -__gridControl ctrlSetText format ["%1", _dagrGrid]; -__speedControl ctrlSetText format ["%1", _dagrDist]; -__elevationControl ctrlSetText format ["%1", _dagrElevation]; -__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] }); -__timeControl ctrlSetText format ["%1", _dagrTime]; +__gridControl ctrlSetText _dagrGrid; +__speedControl ctrlSetText _dagrDist; +__elevationControl ctrlSetText _dagrElevation; +__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _bearing } else { format ["%1°", _bearing] }); +__timeControl ctrlSetText _dagrTime; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 2e0588ccc4..27944f0bb9 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -85,10 +85,10 @@ GVAR(outputPFH) = [{ }); // Output - __gridControl ctrlSetText format ["%1", _dagrGrid]; - __speedControl ctrlSetText format ["%1", _bearing]; - __elevationControl ctrlSetText format ["%1", _dagrGrid2]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] }); - __timeControl ctrlSetText format ["%1", _dagrDistance]; + __gridControl ctrlSetText _dagrGrid; + __speedControl ctrlSetText str _bearing; + __elevationControl ctrlSetText _dagrGrid2; + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _dagrHeading } else { format ["%1°", _dagrHeading] }); + __timeControl ctrlSetText _dagrDistance; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index e05e27c87e..11d7bd470b 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -55,7 +55,7 @@ params ["_listBoxCtrl", "_itemsCountArray"]; }; }; - _listBoxCtrl lbAdd format ["%1", _displayName]; + _listBoxCtrl lbAdd _displayName; _listBoxCtrl lbSetData [((lbSize _listBoxCtrl) - 1), _classname]; _listBoxCtrl lbSetPicture [((lbSize _listBoxCtrl) - 1), _picture]; _listBoxCtrl lbSetTextRight [((lbSize _listBoxCtrl) - 1), str _count]; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index bee84c5b0f..40b3bb6959 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -50,7 +50,7 @@ if (isServer) then { ["ace_unconscious", { params ["_unit", "_isUnconscious"]; if (!_isUnconscious) exitWith {}; - TRACE_1("Knocked Out, Doing Deadman", _unit); + TRACE_1("Knocked Out, Doing Deadman",_unit); [_unit] call FUNC(onIncapacitated); }] call CBA_fnc_addEventHandler; }; diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 423e8932c3..918bbb0c33 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -161,7 +161,7 @@ GVAR(TweakedAngle) = 0; private _placeAngle = 0; private _expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition)); - TRACE_1("Planting Mass", (getMass _expSetupVehicle)); + TRACE_1("Planting Mass",(getMass _expSetupVehicle)); //If the object is too heavy, it can kill a player if it colides if ((getMass _expSetupVehicle) > 5) then {_expSetupVehicle setMass 5;}; diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index dedef1c74e..52edd6417f 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []]; @@ -50,7 +50,7 @@ if (_zeroDistance > 0) then { private _antiOffset = _gunner getVariable QGVAR(lastAntiOffset); _offset = _offset - _antiOffset; - TRACE_4("fired",_gunner, currentZeroing _gunner, _antiOffset, _offset); + TRACE_4("fired",_gunner,currentZeroing _gunner,_antiOffset,_offset); }; [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); diff --git a/addons/finger/XEH_postInit.sqf b/addons/finger/XEH_postInit.sqf index caa2ab54e8..641c94ff92 100644 --- a/addons/finger/XEH_postInit.sqf +++ b/addons/finger/XEH_postInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; ["CBA_settingsInitialized", { //If not enabled, dont't bother adding eventhandler - TRACE_1("CBA_settingsInitialized eh", GVAR(enabled)); + TRACE_1("CBA_settingsInitialized eh",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; GVAR(lastFPTime) = -1; diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index fb65d8eac9..4509a270db 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -25,12 +25,12 @@ private _fingerPos = if (_sourceUnit == ACE_player) then { _fingerPosPrecise vectorAdd ([random (2 * FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2 * FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2 * FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y] vectorMultiply _distance) }; -TRACE_3("incoming finger:", _sourceUnit, _fingerPosPrecise, _fingerPos); +TRACE_3("incoming finger:",_sourceUnit,_fingerPosPrecise,_fingerPos); private _data = [diag_tickTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName)), _sourceUnit]; GVAR(fingersHash) set [hashValue _sourceUnit, _data]; if (GVAR(pfeh_id) == -1) then { GVAR(pfeh_id) = [DFUNC(perFrameEH), 0, []] call CBA_fnc_addPerFrameHandler; - TRACE_1("Started PFEH", GVAR(pfeh_id)); + TRACE_1("Started PFEH",GVAR(pfeh_id)); }; diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index e499ff8808..4af4f6b643 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -44,7 +44,7 @@ private _iconBaseSize = GVAR(sizeCoef) * BASE_SIZE * 0.10713 * (call EFUNC(commo } forEach GVAR(fingersHash); if (GVAR(fingersHash) isEqualTo createHashMap) then { - TRACE_1("Ending PFEH", GVAR(pfeh_id)); + TRACE_1("Ending PFEH",GVAR(pfeh_id)); [GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler; GVAR(pfeh_id) = -1; }; diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 125cb59140..382c06293b 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -10,7 +10,7 @@ }] call CBA_fnc_addEventHandler; ["ace_settingsInitialized", { - TRACE_1("settingsInit", GVAR(enabled)); + TRACE_1("settingsInit",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; if (isServer) then { diff --git a/addons/fire/functions/fnc_burn.sqf b/addons/fire/functions/fnc_burn.sqf index 08d52bd05c..a98aea9bc8 100644 --- a/addons/fire/functions/fnc_burn.sqf +++ b/addons/fire/functions/fnc_burn.sqf @@ -189,7 +189,7 @@ if (_isBurning) exitWith {}; if ((_unit isEqualTo vehicle _unit) && (_sdr || ({ 0.05 > random 1 }))) then { _unit setVariable [QGVAR(stopDropRoll), true]; if !(_sdr) then { - TRACE_1("stop, drop, roll!", _unit); + TRACE_1("stop,drop,roll!",_unit); _unit setUnitPos "DOWN"; doStop _unit; }; @@ -203,7 +203,7 @@ if (_isBurning) exitWith {}; private _vehicle = vehicle _unit; if (_vehicle != _unit) then { - TRACE_1("Ejecting", _unit); + TRACE_1("Ejecting",_unit); _unit leaveVehicle _vehicle; unassignVehicle _unit; _unit action ["eject",_vehicle]; diff --git a/addons/fortify/functions/fnc_createObjectMarker.sqf b/addons/fortify/functions/fnc_createObjectMarker.sqf index 185ae640eb..ce6fd279b0 100644 --- a/addons/fortify/functions/fnc_createObjectMarker.sqf +++ b/addons/fortify/functions/fnc_createObjectMarker.sqf @@ -29,7 +29,7 @@ private _direction = getDir _object; // Marker name unique to this object private _markerNameStr = format [QGVAR(marker_%1), hashValue _object]; -private _channel = if (GVAR(markObjectsOnMap) == 2) then { 0 } else { 1 }; +private _channel = parseNumber (GVAR(markObjectsOnMap) != 2); private _marker = createMarkerLocal [_markerNameStr, _object, _channel, _unit]; TRACE_2("created",_marker,_channel); diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf index 7c2b5d1681..358a9ee71e 100644 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ b/addons/frag/functions/fnc_addPfhRound.sqf @@ -67,7 +67,7 @@ if (alive _round) then { getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force)), getNumber (configFile >> "CfgAmmo" >> _type >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))) ]; - TRACE_1("Initializing track", _round); + TRACE_1("Initializing track",_round); GVAR(objects) pushBack _round; GVAR(arguments) pushBack _args; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 355da901c6..7ea4212d9a 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -17,7 +17,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); private _shouldAdd = GVAR(cacheRoundsTypesToTrack) getVariable _ammo; if (isNil "_shouldAdd") then { diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index f2700654c3..87fabc4fc5 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -144,7 +144,7 @@ if (_objects isNotEqualTo []) then { private _vel = _vec vectorMultiply _fp; private _fragObj = (selectRandom _fragTypes) createVehicleLocal [0,0,10000]; - // TRACE_4("targeted",_fp, typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); + // TRACE_4("targeted",_fp,typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); _fragObj setPosASL _lastPos; _fragObj setVectorDir _vec; _fragObj setVelocity _vel; diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf index 6e75e80951..ef0fbc3eda 100644 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -45,7 +45,7 @@ while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}} // Clean up dead object references private _deletionCount = 0; { - TRACE_1("GC Projectile", _x); + TRACE_1("GC Projectile",_x); private _deleteIndex = _x - _deletionCount; GVAR(objects) deleteAt _deleteIndex; GVAR(arguments) deleteAt _deleteIndex; diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf index ea3455dcee..0c711169ef 100644 --- a/addons/goggles/functions/fnc_handleFired.sqf +++ b/addons/goggles/functions/fnc_handleFired.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); // no dust in rain if (rain > 0.1) exitWith {true}; diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 4105e861f6..9a0168da3e 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (_weapon != "Throw") exitWith {}; diff --git a/addons/headless/functions/fnc_transferGroups.sqf b/addons/headless/functions/fnc_transferGroups.sqf index cee85a5109..37580c4fff 100644 --- a/addons/headless/functions/fnc_transferGroups.sqf +++ b/addons/headless/functions/fnc_transferGroups.sqf @@ -132,7 +132,7 @@ private _numTransferredHC3 = 0; }; }; default { - TRACE_1("No Valid HC to transfer to", _currentHC); + TRACE_1("No Valid HC to transfer to",_currentHC); }; }; }; @@ -140,7 +140,7 @@ private _numTransferredHC3 = 0; if (XGVAR(log)) then { private _numTransferredTotal = _numTransferredHC1 + _numTransferredHC2 + _numTransferredHC3; - INFO_4("Groups Transferred: Total: %1 - HC1: %2 - HC2: %3 - HC3: %4", _numTransferredTotal, _numTransferredHC1, _numTransferredHC2, _numTransferredHC3); + INFO_4("Groups Transferred: Total: %1 - HC1: %2 - HC2: %3 - HC3: %4",_numTransferredTotal,_numTransferredHC1,_numTransferredHC2,_numTransferredHC3); }; // Allow rebalance flag diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index b73c94bf01..f467352410 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -48,7 +48,7 @@ _caliber = call { if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - if (_caliber <= 0) then { 6.5 } else { _caliber }; + [_caliber, 6.5] select (_caliber <= 0); }; private _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 98ee093381..0d8596f53b 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -27,7 +27,9 @@ params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"]; if (_weapon in ["Throw", "Put"]) exitWith {}; if (_distance > 50) exitWith {}; -private _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; +private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select ( + (ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player} +); private _distance = 1 max _distance; private _silencer = switch (_weapon) do { @@ -78,7 +80,7 @@ if (isNil "_loudness") then { if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - if (_caliber <= 0) then { 6.5 } else { _caliber }; + [_caliber, 6.5] select (_caliber <= 0) }; _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index 28dda99086..26bc3f1ff0 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -93,5 +93,5 @@ if (_attackStage >= 3 && { _seekerType isEqualTo "ARH" }) then { }; }; -// TRACE_1("Adjusted target position", _returnTargetPos); +// TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf index fb12cad00f..14d89f82e3 100644 --- a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -31,11 +31,10 @@ private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeigh private _startingStage = if (_configLaunchHeightClear > 0) then { STAGE_LAUNCH; // LOAL-HI / LO } else { - if (_seekerTargetPos isEqualTo [0,0,0]) then { - STAGE_SEEK_CRUISE; // LOAL-DIR - } else { - STAGE_ATTACK_CRUISE // LOBL - }; + [ + STAGE_ATTACK_CRUISE, + STAGE_SEEK_CRUISE + ] select (_seekerTargetPos isEqualTo [0,0,0]); }; // Set data in param array diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 54b6516fff..c306595fc7 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -145,7 +145,7 @@ GVAR(no_cams) sort true; GVAR(cam) camCommit 0; ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]]; - ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]]; + ctrlSetText [2, str (GVAR(cur_cam) + 1)]; private _cam_time = CBA_missionTime - (GVAR(huntIR) getVariable [QGVAR(startTime), CBA_missionTime]); ctrlSetText [3, format["%1 s", round(_cam_time)]]; private _cam_pos = getPosVisual GVAR(huntIR); diff --git a/addons/interact_menu/functions/fnc_addActionToZeus.sqf b/addons/interact_menu/functions/fnc_addActionToZeus.sqf index b4dbb69f4a..3175bf14ad 100644 --- a/addons/interact_menu/functions/fnc_addActionToZeus.sqf +++ b/addons/interact_menu/functions/fnc_addActionToZeus.sqf @@ -19,7 +19,7 @@ if (!hasInterface) exitWith { [] }; if (!params [["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith {ERROR("Bad Params"); []}; -if ((_parentPath param [0, ""]) != "ACE_ZeusActions") exitWith {ERROR_1("Bad path %1 - should have ACE_ZeusActions as base", _parentPath); []}; +if ((_parentPath param [0, ""]) != "ACE_ZeusActions") exitWith {ERROR_1("Bad path %1 - should have ACE_ZeusActions as base",_parentPath); []}; TRACE_2("addActionToZeus",_parentPath,_action); private _currentPath = GVAR(ZeusActions); @@ -37,7 +37,7 @@ private _pathValid = false; } forEach _currentPath; } forEach _parentPath; -if (!_pathValid) exitWith {ERROR_1("Bad path %1", _parentPath); []}; +if (!_pathValid) exitWith {ERROR_1("Bad path %1",_parentPath); []}; TRACE_1("Adding Action",_currentPath); _currentPath pushBack [_action, []]; diff --git a/addons/interact_menu/functions/fnc_addMainAction.sqf b/addons/interact_menu/functions/fnc_addMainAction.sqf index 86b37bf416..83349c21b3 100644 --- a/addons/interact_menu/functions/fnc_addMainAction.sqf +++ b/addons/interact_menu/functions/fnc_addMainAction.sqf @@ -27,7 +27,7 @@ if (isNil "_actionTrees") then { private _parentNode = [_actionTrees, ["ACE_MainActions"]] call FUNC(findActionNode); if (isNil {_parentNode}) then { - TRACE_2("No Main Action on object", _objectType, _typeNum); + TRACE_2("No Main Action on object",_objectType,_typeNum); private _mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call FUNC(createAction); [_objectType, _typeNum, [], _mainAction] call EFUNC(interact_menu,addActionToClass); }; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 35b0ea7177..5290d8f284 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -45,7 +45,7 @@ private _recurseFnc = { private _displayName = getText (_entryCfg >> "displayName"); private _distance = _parentDistance; if (isNumber (_entryCfg >> "distance")) then {_distance = getNumber (_entryCfg >> "distance");}; - // if (_distance < _parentDistance) then {WARNING_3("[%1] distance %2 less than parent %3", configName _entryCfg, _distance, _parentDistance);}; + // if (_distance < _parentDistance) then {WARNING_3("[%1] distance %2 less than parent %3",configName _entryCfg,_distance,_parentDistance);}; private _icon = if (isArray (_entryCfg >> "icon")) then { getArray (_entryCfg >> "icon"); } else { @@ -74,7 +74,7 @@ private _recurseFnc = { if (_condition isEqualTo "") then {_condition = "true"}; } else { // Add canInteract (including exceptions) and canInteractWith to condition - private _canInteractCondition = format [QUOTE([ARR_3(ACE_player,_target,%1)] call EFUNC(common,canInteractWith)), getArray (_entryCfg >> "exceptions")]; + private _canInteractCondition = format [QUOTE([ARR_3(ACE_player,_target,%1)] call EFUNC(common,canInteractWith)),getArray (_entryCfg >> "exceptions")]; private _conditionFormatPattern = ["%1 && {%2}", "%2"] select (_condition isEqualTo "" || {_condition == "true"}); _condition = format [_conditionFormatPattern, _condition, _canInteractCondition]; }; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index d920922ddb..ae00f4fb82 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -49,7 +49,7 @@ _position = if (_position isEqualType "") then { } else { if (_position isEqualType []) then { // If the action is set to a array position, create the suitable code - compile format ["%1", _position]; + compile str _position; } else { _position; }; diff --git a/addons/interact_menu/functions/fnc_createVehiclesActions.sqf b/addons/interact_menu/functions/fnc_createVehiclesActions.sqf index 54f92967c2..3aef7b4552 100644 --- a/addons/interact_menu/functions/fnc_createVehiclesActions.sqf +++ b/addons/interact_menu/functions/fnc_createVehiclesActions.sqf @@ -30,6 +30,6 @@ _vehicles apply { _name = format ["%1 (%2m)", _name, _distanceStr]; }; private _icon = [_x] call EFUNC(common,getVehicleIcon); - private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); + private _action = [str _x, _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); [_action, [], _target] } diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 55aa0f4f82..6772b61c54 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -35,7 +35,7 @@ if (isNil {_parentNode}) exitWith {}; private _found = false; { if (((_x select 0) select 0) == _actionName) exitWith { - TRACE_2("Deleting Action", _forEachIndex, _x); + TRACE_2("Deleting Action",_forEachIndex,_x); _found = true; (_parentNode select 1) deleteAt _forEachIndex; }; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index e7bb42b4cf..3aa8a05ab3 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -95,7 +95,7 @@ if (_useListMenu) then { _scaleX = _textSize * 0.17 * 1.1; _scaleY = 0.17 * 0.30 * 4/3; } else { - private _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; + private _textSIze = [1, 1.3] select (GVAR(textSize) > 2); _scaleX = _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); _scaleY = _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 75e92c02c9..a5f7170588 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -136,7 +136,7 @@ GVAR(isOpeningDoor) = false; if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; //Tap whichever shoulder is closest - private _shoulderNum = [0, 1] select (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180); + private _shoulderNum = parseNumber (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180); // Statement [ACE_player, cursorTarget, _shoulderNum] call FUNC(tapShoulder); diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 40ba9672ef..50b0d98a21 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -43,7 +43,7 @@ private _icon = ""; _actions pushBack [ [ - format ["%1", _unit], + str _unit, [_unit, true] call EFUNC(common,getName), [_icon, "#FFFFFF"], { diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index a03ca26c04..540712ef41 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -71,7 +71,7 @@ GVAR(usedScrollWheel) = false; // didn't use incremental opening. Just do animation normally. if !(GVAR(usedScrollWheel)) then { - private _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + private _phase = parseNumber (_house animationPhase (_animations select 0) < 0.5); {_house animate [_x, _phase]; false} count _animations; }; diff --git a/addons/javelin/functions/fnc_mapHelperDraw.sqf b/addons/javelin/functions/fnc_mapHelperDraw.sqf index 2794d46f58..4f7ac84b4a 100644 --- a/addons/javelin/functions/fnc_mapHelperDraw.sqf +++ b/addons/javelin/functions/fnc_mapHelperDraw.sqf @@ -18,7 +18,7 @@ */ if (isNil QGVAR(arguments)) then { - TRACE_1("Starting optic draw", _this); + TRACE_1("Starting optic draw",_this); // reset shooter var: private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index e6809a8e04..aacc4f5fa1 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -146,13 +146,13 @@ if (isNull _newTarget) then { _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); } else { if ((!isNull _newTarget) && {_currentTarget != _newTarget}) then { - TRACE_1("New Target, reseting locking", _newTarget); + TRACE_1("New Target, reseting locking",_newTarget); _lockStartTime = CBA_missionTime; _currentTarget = _newTarget; }; if ((CBA_missionTime - _lockStartTime) > __LOCKONTIME) then { // Lock on after 3 seconds - TRACE_2("LOCKED!", _currentTarget, _lockStartTime); + TRACE_2("LOCKED!",_currentTarget,_lockStartTime); __JavelinIGUISeek ctrlSetTextColor __ColorGreen; __JavelinIGUITargetingLines ctrlShow true; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index 2143904f80..59bb3056dd 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -93,7 +93,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 1: { // Direction if (!GVAR(MinAvgMax)) then { - _textCenterBig = format["%1", format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]]; + _textCenterBig = format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]; } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; diff --git a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf index b8cedf22c3..bd42a3e5a5 100644 --- a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf +++ b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf @@ -24,13 +24,13 @@ TRACE_1("params",_this); private _owners = allUnits select {(lasertarget _x) == _targetObject}; if (count _owners == 1) exitWith { - TRACE_2("Laser target owner [allUnits]", _targetObject, _owners select 0); + TRACE_2("Laser target owner [allUnits]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; _owners = vehicles select {(lasertarget _x) == _targetObject}; if (count _owners == 1) exitWith { - TRACE_2("Laser target owner [vehicles]", _targetObject, _owners select 0); + TRACE_2("Laser target owner [vehicles]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; @@ -58,7 +58,7 @@ TRACE_1("params",_this); }; }; if (!_foundSource) then { - WARNING_1("Laser target doesn't have owner", _targetObject); + WARNING_1("Laser target doesn't have owner",_targetObject); }; }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index 5c5f51931b..0b19b4d1c3 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -26,7 +26,7 @@ GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { // Turn off the laser in ace_laser [_laserUuid] call FUNC(laserOff); - TRACE_1("Laser off:", _laserUuid); + TRACE_1("Laser off:",_laserUuid); false } else { private _newCode = _owner getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 9d3e2d6fa1..d1e4626d53 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -101,7 +101,7 @@ private _finalOwner = objNull; }; } forEach (values GVAR(laserEmitters)); // Go through all values in hash -TRACE_2("",count _spots, _spots); +TRACE_2("",count _spots,_spots); if ((count _spots) > 0) then { private _bucketList = nil; diff --git a/addons/laser/functions/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf index 434560eea7..862e972dd1 100644 --- a/addons/laser/functions/fnc_shootRay.sqf +++ b/addons/laser/functions/fnc_shootRay.sqf @@ -21,7 +21,7 @@ BEGIN_COUNTER(shootRay); params ["_posASL", "_dir", ["_ignoreVehicle1", objNull], ["_ignoreVehicle2", objNull]]; -// TRACE_2("ray origin:", _posASL, _dir); +// TRACE_2("ray origin:",_posASL,_dir); private _distance = 0; private _resultPos = nil; @@ -43,7 +43,7 @@ if (_intersects isNotEqualTo []) then { _resultPos = _posASL vectorAdd (_dir vectorMultiply _distance); }; -TRACE_3("", _resultPos, _distance, _intersects); +TRACE_3("",_resultPos,_distance,_intersects); #ifdef DRAW_LASER_INFO if (!isNil "_resultPos") then { diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 46e38acb90..2176793aed 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -22,7 +22,10 @@ TRACE_2("Fence cutting started",_unit,_fence); if (_unit != ACE_player) exitWith {}; // Get cut time based on if unit is a engineer -private _cutTime = if (_unit call EFUNC(common,isEngineer)) then {CUT_TIME_ENGINEER} else {CUT_TIME_DEFAULT}; +private _cutTime = [ + CUT_TIME_DEFAULT, + CUT_TIME_ENGINEER +] select (_unit call EFUNC(common,isEngineer)); if !(_unit call EFUNC(common,isSwimming)) then { [_unit, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 56b2b560f4..49b8239e0a 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -19,9 +19,9 @@ GVAR(flashlights) = [] call CBA_fnc_createNamespace; setCurrentChannel GVAR(DefaultChannel); if (currentChannel == GVAR(DefaultChannel)) then { - // INFO_1("Channel Set - %1", currentChannel); + // INFO_1("Channel Set - %1",currentChannel); } else { - ERROR_2("Failed To Set Channel %1 (is %2)", GVAR(DefaultChannel), currentChannel); + ERROR_2("Failed To Set Channel %1 (is %2)",GVAR(DefaultChannel),currentChannel); }; }, 0, []] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index f7436e7bf9..af95ce3d6d 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -22,4 +22,4 @@ params ["_logic"]; [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_ShowPlayerNames), "ShowPlayerNames"] call EFUNC(common,readSettingFromModule); -INFO_3("Blue Force Tracking Module Initialized:", GVAR(BFT_Enabled), GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); +INFO_3("Blue Force Tracking Module Initialized:",GVAR(BFT_Enabled),GVAR(BFT_Interval),GVAR(BFT_HideAiGroups)); diff --git a/addons/marker_flags/functions/fnc_placeFlag.sqf b/addons/marker_flags/functions/fnc_placeFlag.sqf index 74dc615588..5dd2abb376 100644 --- a/addons/marker_flags/functions/fnc_placeFlag.sqf +++ b/addons/marker_flags/functions/fnc_placeFlag.sqf @@ -18,13 +18,13 @@ */ params [["_player", objNull, [objNull]], ["_item", QGVAR(white), [""]]]; -TRACE_2("Placing flag", _player, _item); +TRACE_2("Placing flag",_player,_item); (GVAR(flagCache) get _item) params ["_vehicleClass"]; private _flag = _vehicleClass createVehicle [0, 0, 0]; -TRACE_1("Created flag", _flag); +TRACE_1("Created flag",_flag); // Set flag start height GVAR(objectHeight) = MAX_HEIGHT; diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf index 25e8317b75..43a1acbf29 100644 --- a/addons/markers/XEH_postInit.sqf +++ b/addons/markers/XEH_postInit.sqf @@ -32,7 +32,7 @@ GVAR(userPlacedMarkers) = []; if (_index < 0) exitWith { if (!isMultiplayer) exitWith {}; - WARNING_1("Could not find data for %1", _marker); + WARNING_1("Could not find data for %1",_marker); }; private _data = GVAR(allMapMarkersProperties) select _index; diff --git a/addons/medical/dev/watchVariable.sqf b/addons/medical/dev/watchVariable.sqf index 0eb191e8dd..05cb094ba8 100644 --- a/addons/medical/dev/watchVariable.sqf +++ b/addons/medical/dev/watchVariable.sqf @@ -28,7 +28,7 @@ GVAR(dev_watchVariableRunning) = true; _return pushBack format ["State: %2", _color, _targetState]; private _hasStableVitals = ["N", "Y"] select ([_unit] call EFUNC(medical_status,hasStableVitals)); private _hasStableCondition = ["N", "Y"] select ([_unit] call EFUNC(medical_status,isInStableCondition)); - private _unconcFlag = if IS_UNCONSCIOUS(_unit) then {"[U]"} else {""}; + private _unconcFlag = ["", "[U]"] select IS_UNCONSCIOUS(_unit); private _timeLeft = _unit getVariable [QEGVAR(medical_statemachine,cardiacArrestTimeLeft), -1]; private _cardiactArrestFlag = if IN_CRDC_ARRST(_unit) then {format ["[CA %1]", _timeLeft toFixed 1]} else {""}; _return pushBack format ["[StableVitals: %1] [StableCon: %2] %3 %4", _hasStableVitals, _hasStableCondition, _unconcFlag, _cardiactArrestFlag]; @@ -38,7 +38,7 @@ GVAR(dev_watchVariableRunning) = true; private _woundBleeding = GET_WOUND_BLEEDING(_unit); private _bloodLoss = GET_BLOOD_LOSS(_unit); private _hemorrhage = GET_HEMORRHAGE(_unit); - private _isBleeding = if (IS_BLEEDING(_unit)) then {"Bleeding"} else {""}; + private _isBleeding = ["", "[Bleeding]"] select IS_BLEEDING(_unit); private _secondsToHeartstop = if (_bloodLoss != 0) then {format ["[Time Left: %1 sec]", (((_bloodVolume - BLOOD_VOLUME_CLASS_4_HEMORRHAGE) max 0) / _bloodLoss) toFixed 0]} else {""}; _return pushBack format ["Blood: %1 [Hemorrhage: %2] %3", _bloodVolume toFixed 3, _hemorrhage, _isBleeding]; _return pushBack format [" - [W: %1 T: %2] %3", _woundBleeding toFixed 4, _bloodLoss toFixed 4, _secondsToHeartstop]; @@ -60,7 +60,7 @@ GVAR(dev_watchVariableRunning) = true; // Damage: private _damage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; - private _limping = if (_unit getVariable [QEGVAR(medical,isLimping), false]) then {"[ Limping ]"} else {""}; + private _limping = ["", "[ Limping ]"] select (_unit getVariable [QEGVAR(medical,isLimping), false]); _return pushBack format ["BodyPartDamage: [H: %1] [B: %2]", (_damage select 0) toFixed 2, (_damage select 1) toFixed 2]; _return pushBack format ["[LA:%1] [RA: %2] [LL:%3] [RL: %4]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2]; @@ -68,8 +68,8 @@ GVAR(dev_watchVariableRunning) = true; _return pushBack format ["[HHnd:%1] [HLeg: %2] %3", (_unit getHitPointDamage "HitHands") toFixed 2, (_unit getHitPointDamage "HitLegs") toFixed 2, _limping]; private _fractures = GET_FRACTURES(_unit); - private _canSprint = if (isSprintAllowed _unit) then {""} else {"[Sprint Blocked]"}; - private _forceWalk = if (isForcedWalk _unit) then {"[Forced Walking]"} else {""}; + private _canSprint = ["[Sprint Blocked]", ""] select (isSprintAllowed _unit); + private _forceWalk = ["", "[Forced Walking]"] select (isForcedWalk _unit); _return pushBack format ["Fractures: %1 %2%3", _fractures, _canSprint, _forceWalk]; diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index 23ac9f0990..3d82cbe77a 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -37,12 +37,12 @@ TRACE_7("addDamageToUnit",_unit,_damageToAdd,_bodyPart,_typeOfDamage,_instigator _bodyPart = toLower _bodyPart; private _bodyPartIndex = ALL_BODY_PARTS find _bodyPart; if (_bodyPartIndex < 0) then { _bodyPartIndex = ALL_SELECTIONS find _bodyPart; }; // 2nd attempt with selection names ("hand_l", "hand_r", "leg_l", "leg_r") -if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1", _this); false}; -if (isNull _unit || {!local _unit} || {!alive _unit}) exitWith {ERROR_2("addDamageToUnit - badUnit %1 [local %2]", _this, local _unit); false}; -if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1", _this); false}; +if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1",_this); false}; +if (isNull _unit || {!local _unit} || {!alive _unit}) exitWith {ERROR_2("addDamageToUnit - badUnit %1 [local %2]",_this,local _unit); false}; +if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1",_this); false}; if (!_overrideInvuln && {!((isDamageAllowed _unit) && {_unit getVariable [QEGVAR(medical,allowDamage), true]})}) exitWith { - ERROR_1("addDamageToUnit - unit invulnerable %1", _this); false + ERROR_1("addDamageToUnit - unit invulnerable %1",_this); false }; // Extension is case sensitive and expects this format (different from ALL_BODY_PARTS) @@ -69,7 +69,7 @@ private _selectionSpecific = true; if (isClass _config) then { _selectionSpecific = (getNumber (_config >> "selectionSpecific")) == 1; } else { - WARNING_2("Damage type not in config [%1:%2]", _typeOfDamage, _config); + WARNING_2("Damage type not in config [%1:%2]",_typeOfDamage,_config); }; INFO_4("Debug AddDamageToUnit: Type [%1] - Selection Specific [%2] - HitPoint [%3 -> %4]",_typeOfDamage,_selectionSpecific,_startDmg select _bodyPartIndex,_endDmg select _bodyPartIndex); INFO_4("Pain Change [%1 -> %2] - BodyPartDamage Change [%3 -> %4]",_startPain,_endPain,_startDmg,_endDmg); diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index cf078ae64b..a1de71c36b 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -38,7 +38,7 @@ if (!local _unit) exitWith { }; if (_knockOut isEqualTo IS_UNCONSCIOUS(_unit)) exitWith { - WARNING_2("setUnconscious called with no change [Unit %1] [State [%2]", _unit, _knockOut); + WARNING_2("setUnconscious called with no change [Unit %1] [State [%2]",_unit,_knockOut); false }; diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index c53cb78934..0b225c7f0b 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" ["CBA_settingsInitialized", { - TRACE_1("settingsInitialized", GVAR(enabledFor)); + TRACE_1("settingsInitialized",GVAR(enabledFor)); if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients diff --git a/addons/medical_ai/XEH_preStart.sqf b/addons/medical_ai/XEH_preStart.sqf index 52e3374924..b4d795cbbf 100644 --- a/addons/medical_ai/XEH_preStart.sqf +++ b/addons/medical_ai/XEH_preStart.sqf @@ -13,7 +13,7 @@ private _itemHash = createHashMap; private _items = getArray (configFile >> "ace_medical_treatment_actions" >> _x >> "items"); if (_items isEqualTo []) then { ERROR_1("bad action %1",_x); }; private _itemClassname = configName (configFile >> "CfgWeapons" >> _items # 0); - private _treatment = if ((count _treatments) > 1) then { _x } else { "" }; + private _treatment = ["", _x] select ((count _treatments) > 1); _typeHash set [_itemClassname, _treatment]; } forEach _treatments; _itemHash set [_itemType, _typeHash]; diff --git a/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf b/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf index f2441b3704..4dfcbe840a 100644 --- a/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf @@ -38,7 +38,7 @@ private _classID = 0; private _details = [_selections, _bleeding, _pain, _causeLimping, _causeFracture]; GVAR(woundDetails) set [_className, _details]; GVAR(woundDetails) set [_classID, _details]; - + GVAR(woundClassNames) pushBack _className; { GVAR(woundClassNamesComplex) set [10 * _classID + _forEachIndex, format ["%1%2", _className, _x]]; @@ -61,7 +61,7 @@ if (isClass (_damageTypesConfig >> "woundHandlers")) then { _defaultWoundHandlers = [_damageTypesConfig >> "woundHandlers"] call FUNC(parseWoundHandlersCfg); reverse _defaultWoundHandlers; }; -TRACE_1("Found default wound handlers", count _defaultWoundHandlers); +TRACE_1("Found default wound handlers",count _defaultWoundHandlers); // Collect all available damage types from the config { @@ -77,15 +77,15 @@ TRACE_1("Found default wound handlers", count _defaultWoundHandlers); private _thresholds = GET_ARRAY(_damageTypeSubClassConfig >> "thresholds",_thresholdsDefault); private _selectionSpecific = GET_NUMBER(_damageTypeSubClassConfig >> "selectionSpecific",_selectionSpecificDefault); - + private _woundHandlers = []; if (isClass (_damageTypeSubClassConfig >> "woundHandlers")) then { _woundHandlers = [_damageTypeSubClassConfig >> "woundHandlers"] call FUNC(parseWoundHandlersCfg); reverse _woundHandlers; - TRACE_2("Damage type found wound handlers", _className, count _woundHandlers); + TRACE_2("Damage type found wound handlers",_className,count _woundHandlers); } else { _woundHandlers = _defaultWoundHandlers; - TRACE_1("Damage type has no wound handlers, using default", _className); + TRACE_1("Damage type has no wound handlers, using default",_className); }; /* @@ -115,11 +115,11 @@ TRACE_1("Found default wound handlers", count _defaultWoundHandlers); if (_woundType == "woundHandlers") then {continue}; if (_woundType in GVAR(woundDetails)) then { private _weighting = GET_ARRAY(_x >> "weighting",[[ARR_2(0,1)]]); - private _dmgMulti = GET_NUMBER(_x >> "damageMultiplier", 1); - private _bleedMulti = GET_NUMBER(_x >> "bleedingMultiplier", 1); - private _sizeMulti = GET_NUMBER(_x >> "sizeMultiplier", 1); - private _painMulti = GET_NUMBER(_x >> "painMultiplier", 1); - private _fractureMulti = GET_NUMBER(_x >> "fractureMultiplier", 1); + private _dmgMulti = GET_NUMBER(_x >> "damageMultiplier",1); + private _bleedMulti = GET_NUMBER(_x >> "bleedingMultiplier",1); + private _sizeMulti = GET_NUMBER(_x >> "sizeMultiplier",1); + private _painMulti = GET_NUMBER(_x >> "painMultiplier",1); + private _fractureMulti = GET_NUMBER(_x >> "fractureMultiplier",1); _damageWoundDetails pushBack [_woundType, _weighting, _dmgMulti, _bleedMulti, _sizeMulti, _painMulti, _fractureMulti]; } else { WARNING_2("Damage type %1 refers to wound %2, but it doesn't exist: skipping.",_className,configName _x); diff --git a/addons/medical_damage/functions/fnc_woundReceived.sqf b/addons/medical_damage/functions/fnc_woundReceived.sqf index 52dbcba265..a7e3861dee 100644 --- a/addons/medical_damage/functions/fnc_woundReceived.sqf +++ b/addons/medical_damage/functions/fnc_woundReceived.sqf @@ -22,14 +22,13 @@ params ["_unit", "_allDamages", "_shooter", "_ammo"]; private _typeOfDamage = _ammo call FUNC(getTypeOfDamage); if (_typeOfDamage in GVAR(damageTypeDetails)) then { (GVAR(damageTypeDetails) get _typeOfDamage) params ["", "", "_woundHandlers"]; - + private _damageData = [_unit, _allDamages, _typeOfDamage]; { _damageData = _damageData call _x; - TRACE_1("Wound handler returned", _damageData); + TRACE_1("Wound handler returned",_damageData); if !(_damageData isEqualType [] && {(count _damageData) >= 3}) exitWith { - TRACE_1("Return invalid, terminating wound handling", _damageData); + TRACE_1("Return invalid, terminating wound handling",_damageData); }; } forEach _woundHandlers; - }; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf b/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf index 64ac637107..9aaaf4a382 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf @@ -24,5 +24,5 @@ private _newDamages = _allDamages apply { [_x select 0, selectRandom ALL_BODY_PARTS, _x select 2]; }; -TRACE_1("Vehicle crash handled, passing damage", _newDamages); +TRACE_1("Vehicle crash handled, passing damage",_newDamages); [_unit, _newDamages, _typeOfDamage] //return diff --git a/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf b/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf index 5f4bd35941..8f9af8262c 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf @@ -42,5 +42,5 @@ private _newDamages = []; _newDamages pushBack [_damageMap get _x, _x, _damageToApply]; } forEach (keys _damageMap); // micro-optimization again, two 'get's is still faster than iterating over a hashmap -TRACE_1("Vehicle explosion handled, passing damage", _newDamages); +TRACE_1("Vehicle explosion handled, passing damage",_newDamages); [_unit, _newDamages, _typeOfDamage] //return diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index 81de63775b..2514c62254 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -13,7 +13,7 @@ // Check if last hit point is our dummy. private _allHitPoints = getAllHitPointsDamage _unit param [0, []]; reverse _allHitPoints; - while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1", _allHitPoints deleteAt 0); }; + while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1",_allHitPoints deleteAt 0); }; if (_allHitPoints param [0, ""] != "ACE_HDBracket") then { if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; @@ -32,7 +32,7 @@ #ifdef DEBUG_MODE_FULL [QEGVAR(medical,woundReceived), { params ["_unit", "_damages", "_shooter", "_ammo"]; - TRACE_4("wound",_unit,_damages, _shooter, _ammo); + TRACE_4("wound",_unit,_damages,_shooter,_ammo); //systemChat str _this; }] call CBA_fnc_addEventHandler; #endif diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 755b8ad552..a60816222f 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -90,8 +90,8 @@ if ( {_ammo isNotEqualTo ""} && { private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; - GET_NUMBER(_ammoCfg >> "explosive", 0) > 0 || - {GET_NUMBER(_ammoCfg >> "indirectHit", 0) > 0} + GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || + {GET_NUMBER(_ammoCfg >> "indirectHit",0) > 0} } ) exitwith { TRACE_5("Vehicle hit",_unit,_shooter,_instigator,_damage,_newDamage); diff --git a/addons/medical_gui/functions/fnc_collectActions.sqf b/addons/medical_gui/functions/fnc_collectActions.sqf index f9392897f3..1620b2c5cb 100644 --- a/addons/medical_gui/functions/fnc_collectActions.sqf +++ b/addons/medical_gui/functions/fnc_collectActions.sqf @@ -22,8 +22,8 @@ GVAR(actions) = []; private _configName = configName _x; private _displayName = getText (_x >> "displayName"); private _category = getText (_x >> "category"); - private _condition = compile format [QUOTE([ARR_4(ACE_player, GVAR(target), %1 select GVAR(selectedBodyPart), '%2')] call DEFUNC(medical_treatment,canTreatCached)), ALL_BODY_PARTS, _configName]; - private _statement = compile format [QUOTE([ARR_4(ACE_player, GVAR(target), %1 select GVAR(selectedBodyPart), '%2')] call DEFUNC(medical_treatment,treatment)), ALL_BODY_PARTS, _configName]; + private _condition = compile format [QUOTE([ARR_4(ACE_player,GVAR(target),%1 select GVAR(selectedBodyPart),'%2')] call DEFUNC(medical_treatment,canTreatCached)), ALL_BODY_PARTS, _configName]; + private _statement = compile format [QUOTE([ARR_4(ACE_player,GVAR(target),%1 select GVAR(selectedBodyPart),'%2')] call DEFUNC(medical_treatment,treatment)), ALL_BODY_PARTS, _configName]; private _items = getArray (_x >> "items"); GVAR(actions) pushBack [_displayName, _category, _condition, _statement, _items]; diff --git a/addons/medical_gui/functions/fnc_countTreatmentItems.sqf b/addons/medical_gui/functions/fnc_countTreatmentItems.sqf index 102d996bb3..6e8394c82f 100644 --- a/addons/medical_gui/functions/fnc_countTreatmentItems.sqf +++ b/addons/medical_gui/functions/fnc_countTreatmentItems.sqf @@ -38,7 +38,7 @@ if (ACE_player != GVAR(target)) then { // Vehicle private _medicVehicle = objectParent ACE_player; private _patientVehicle = objectParent GVAR(target); -private _vehicle = if (!isNull _medicVehicle) then {_medicVehicle} else {_patientVehicle}; +private _vehicle = [_patientVehicle, _medicVehicle] select (!isNull _medicVehicle); if (!isNull _vehicle) then { _vehicleCount = 0; diff --git a/addons/medical_gui/functions/fnc_handleToggle.sqf b/addons/medical_gui/functions/fnc_handleToggle.sqf index f0448fc3a3..48232790c1 100644 --- a/addons/medical_gui/functions/fnc_handleToggle.sqf +++ b/addons/medical_gui/functions/fnc_handleToggle.sqf @@ -19,15 +19,14 @@ if (!isNull findDisplay 312) exitWith {}; // Find new target to switch to -private _target = if ( +private _target = [ + ACE_player, + GVAR(previousTarget) +] select ( GVAR(target) == ACE_player && {[ACE_player, GVAR(previousTarget)] call EFUNC(common,canInteractWith)} && {[ACE_player, GVAR(previousTarget)] call FUNC(canOpenMenu)} -) then { - GVAR(previousTarget); -} else { - ACE_player; -}; +); // Exit if new target is same as old if (GVAR(target) == _target) exitWith {}; diff --git a/addons/medical_gui/ui/painkillers.paa b/addons/medical_gui/ui/painkillers.paa new file mode 100644 index 0000000000..3c5da9b30b Binary files /dev/null and b/addons/medical_gui/ui/painkillers.paa differ diff --git a/addons/medical_treatment/ACE_Medical_Treatment.hpp b/addons/medical_treatment/ACE_Medical_Treatment.hpp index eeeacf700f..d1ea741cb3 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment.hpp @@ -605,10 +605,13 @@ class ADDON { incompatibleMedication[] = {}; }; class PainKillers { - painReduce = 0.1; - timeInSystem = 600; + painReduce = 0.35; + hrIncreaseLow[] = {-5, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -17}; + timeInSystem = 420; timeTillMaxEffect = 60; - maxDose = 10; + maxDose = 6; incompatibleMedication[] = {}; viscosityChange = 5; }; diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 99a477c3f5..4058132e3d 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -141,6 +141,19 @@ class GVAR(actions) { litter[] = {{"ACE_MedicalLitter_epinephrine"}}; }; + // - Generic Medication --------------------------------------------------- + class Painkillers: Morphine { + displayName = CSTRING(Administer_Painkillers); + displayNameProgress = CSTRING(Administering_Painkillers); + icon = QPATHTOEF(medical_gui,ui\painkillers.paa); + allowedSelections[] = {"Head"}; + medicRequired = 0; + items[] = {"ACE_painkillers"}; + treatmentTime = 4; + sounds[] = {{QPATHTO_R(sounds\Pills.ogg),1,1,50}}; + litter[] = {{"Land_PainKillers_F"}}; // just use BI's model as litter + }; + // - IV Bags -------------------------------------------------------------- class BloodIV: BasicBandage { displayName = CSTRING(Actions_Blood4_1000); diff --git a/addons/medical_treatment/CfgVehicles.hpp b/addons/medical_treatment/CfgVehicles.hpp index c9144704b5..bcecdb155e 100644 --- a/addons/medical_treatment/CfgVehicles.hpp +++ b/addons/medical_treatment/CfgVehicles.hpp @@ -284,6 +284,16 @@ class CfgVehicles { MACRO_ADDITEM(ACE_bodyBag,1); }; }; + class ACE_painkillersItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(painkillers_Display); + author = "Alganthe"; + vehicleClass = "Items"; + class TransportItems { + MACRO_ADDITEM(ACE_painkillers,1); + }; + }; // Medical supply crates class ThingX; @@ -305,6 +315,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class TransportItems { MACRO_ADDITEM(ACE_fieldDressing,50); + MACRO_ADDITEM(ACE_painkillers,25); MACRO_ADDITEM(ACE_morphine,25); MACRO_ADDITEM(ACE_epinephrine,25); MACRO_ADDITEM(ACE_bloodIV,15); @@ -352,6 +363,7 @@ class CfgVehicles { MACRO_ADDITEM(ACE_elasticBandage,25); MACRO_ADDITEM(ACE_tourniquet,15); MACRO_ADDITEM(ACE_splint,15); + MACRO_ADDITEM(ACE_painkillers,15); MACRO_ADDITEM(ACE_morphine,15); MACRO_ADDITEM(ACE_adenosine,15); MACRO_ADDITEM(ACE_epinephrine,15); diff --git a/addons/medical_treatment/CfgWeapons.hpp b/addons/medical_treatment/CfgWeapons.hpp index 7b31e10bee..31b98bd843 100644 --- a/addons/medical_treatment/CfgWeapons.hpp +++ b/addons/medical_treatment/CfgWeapons.hpp @@ -310,4 +310,17 @@ class CfgWeapons { hiddenSelectionsTextures[] = {QPATHTOF(data\bodybagItem_white_co.paa)}; GVAR(bodyBagObject) = "ACE_bodyBagObject_white"; }; + class ACE_painkillers: ACE_ItemCore { + scope = 2; + author = "Alganthe"; + displayName = CSTRING(painkillers_Display); + model = "\A3\Structures_F_EPA\Items\Medical\PainKillers_F.p3d"; + picture = QPATHTOF(ui\painkillers_ca.paa); + descriptionShort = CSTRING(painkillers_Desc_Short); + descriptionUse = CSTRING(painkillers_Desc_Use); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; }; diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index d0ecbddaef..75166a0f0c 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -11,8 +11,8 @@ ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP) class CfgPatches { class ADDON { name = COMPONENT_NAME; - units[] = {"ACE_fieldDressingItem","ACE_packingBandageItem","ACE_elasticBandageItem","ACE_tourniquetItem","ACE_splintItem","ACE_morphineItem","ACE_adenosineItem","ACE_epinephrineItem","ACE_plasmaIVItem","ACE_bloodIVItem","ACE_salineIVItem","ACE_quikClotItem","ACE_personalAidKitItem","ACE_surgicalKitItem","ACE_sutureItem","ACE_bodyBagItem","ACE_medicalSupplyCrate","ACE_medicalSupplyCrate_advanced"}; - weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_morphine","ACE_adenosine","ACE_epinephrine","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_quikclot","ACE_personalAidKit","ACE_surgicalKit","ACE_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white"}; + units[] = {"ACE_fieldDressingItem","ACE_packingBandageItem","ACE_elasticBandageItem","ACE_tourniquetItem","ACE_splintItem","ACE_painkillersItem","ACE_morphineItem","ACE_adenosineItem","ACE_epinephrineItem","ACE_plasmaIVItem","ACE_bloodIVItem","ACE_salineIVItem","ACE_quikClotItem","ACE_personalAidKitItem","ACE_surgicalKitItem","ACE_sutureItem","ACE_bodyBagItem","ACE_medicalSupplyCrate","ACE_medicalSupplyCrate_advanced"}; + weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_painkillers","ACE_morphine","ACE_adenosine","ACE_epinephrine","ACE_plasmaIV","ACE_plasmaIV_500","ACE_plasmaIV_250","ACE_bloodIV","ACE_bloodIV_500","ACE_bloodIV_250","ACE_salineIV","ACE_salineIV_500","ACE_salineIV_250","ACE_quikclot","ACE_personalAidKit","ACE_surgicalKit","ACE_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_medical_status", "ace_medical_damage", "ace_apl"}; author = ECSTRING(common,ACETeam); diff --git a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf index 91c6bf038c..3798e64eb4 100644 --- a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf +++ b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf @@ -39,7 +39,7 @@ private _logOutput = LSTRING(Check_Pulse_None); if (_heartRate > 1) then { if (_medic call FUNC(isMedic)) then { _heartRateOutput = LSTRING(Check_Pulse_Output_1); - _logOutput = format ["%1", round _heartRate]; + _logOutput = str round _heartRate; } else { _heartRateOutput = LSTRING(Check_Pulse_Output_2); _logOutput = LSTRING(Check_Pulse_Weak); diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index 69a6118099..b90198f0eb 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -36,7 +36,7 @@ if (isClass (_config >> _bandage)) then { _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; } else { - WARNING_2("No config for bandage [%1] config base [%2]", _bandage, _config); + WARNING_2("No config for bandage [%1] config base [%2]",_bandage,_config); }; if (isClass (_config >> _className)) then { @@ -54,7 +54,7 @@ if (isClass (_config >> _className)) then { _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; }; } else { - WARNING_2("No config for wound type [%1] config base [%2]", _className, _config); + WARNING_2("No config for wound type [%1] config base [%2]",_className,_config); }; TRACE_5("configs",_bandage,_className,_reopeningChance,_reopeningMinDelay,_reopeningMaxDelay); diff --git a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf index 2d4468d2c4..d04c1497bd 100644 --- a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf @@ -21,7 +21,7 @@ params ["_unit"]; private _fnc_check = { private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; - CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position, _position vectorAdd [ARR_3(0, 0, 10)], _unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} + CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position,_position vectorAdd [ARR_3(0,0,10)],_unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} }; [[], _fnc_check, _unit, QGVAR(inMedicalFacilityCache), IN_MEDICAL_FACILITY_CACHE_EXPIRY] call EFUNC(common,cachedCall); diff --git a/addons/medical_treatment/sounds/Pills.ogg b/addons/medical_treatment/sounds/Pills.ogg new file mode 100644 index 0000000000..7fbe550554 Binary files /dev/null and b/addons/medical_treatment/sounds/Pills.ogg differ diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index bd6be9e1da..05bb62a646 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -4933,5 +4933,33 @@ Zeus操作中は、すべての治療時間にこの係数を掛けます。 제우스일 때 모든 치료 시간에 이 계수를 곱합니다. + + Painkillers + Léky proti bolesti + Schmerztabellen + Болеутоляющее + Środki przeciwbólowe + Antidolorifici + Analgésicos + Analgésiques + 止痛藥 + 鎮痛剤 + 진통제 + Analgésicos + 止痛药 + Ağrı kesici + + + Administer Painkillers + + + Administering Painkillers... + + + Over-the-counter analgesic used to combat light to moderate pain experiences. + + + Over-the-counter analgesic used to combat light to moderate pain experiences. + diff --git a/addons/medical_treatment/ui/painkillers_ca.paa b/addons/medical_treatment/ui/painkillers_ca.paa new file mode 100644 index 0000000000..15036c85cb Binary files /dev/null and b/addons/medical_treatment/ui/painkillers_ca.paa differ diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 30a0c6ad6e..86415a1914 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -60,7 +60,7 @@ if (GVAR(currentApplicationPage) == 1) then { _size = 32 * _mapSize; { _x params ["_wpName", "_wpPos"]; - private _alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5}; + private _alpha = [0.5, 1] select (_forEachIndex == GVAR(currentWaypoint)); _theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ]; } forEach _waypoints; }; diff --git a/addons/minedetector/functions/fnc_getDetectedObject.sqf b/addons/minedetector/functions/fnc_getDetectedObject.sqf index 6827e59c99..810e4d4ff4 100644 --- a/addons/minedetector/functions/fnc_getDetectedObject.sqf +++ b/addons/minedetector/functions/fnc_getDetectedObject.sqf @@ -49,7 +49,7 @@ private _distance = -1; if (_isDetectable && {!isNull _x}) exitWith { _distance = _detectorPointAGL distance _x; _mine = _x; - TRACE_3("return", _isDetectable, _mine, _distance); + TRACE_3("return",_isDetectable,_mine,_distance); }; } forEach _nearestObjects; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index 6ddb60d21b..b690ab2075 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -69,5 +69,5 @@ switch (_attackProfileStateParams select 0) do { }; }; -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index d7092a924d..f1f360e403 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -58,7 +58,7 @@ switch( (_attackProfileStateParams select 0) ) do { private _cruisAlt = 140; if (_distanceShooterToTarget < 1250) then { _cruisAlt = 140 * (_distanceShooterToTarget/1250); - TRACE_1("_cruisAlt", _cruisAlt); + TRACE_1("_cruisAlt",_cruisAlt); }; if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { if (_cruisAlt < 140) then { @@ -72,7 +72,7 @@ switch( (_attackProfileStateParams select 0) ) do { }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - TRACE_1("", ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ); + TRACE_1("",((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2)); if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { @@ -86,5 +86,5 @@ switch( (_attackProfileStateParams select 0) ) do { }; }; -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 23476ec46c..e346b16eb6 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -30,7 +30,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _addHeight = [0,0,0]; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 132af330c3..0620e9e3c0 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -37,7 +37,7 @@ private _adjustTime = 1; if (accTime > 0) then { _adjustTime = 1/accTime; _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); - TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); + TRACE_4("Adjust timing",1/accTime,_adjustTime,_runtimeDelta,(_runtimeDelta / TIMESTEP_FACTOR)); } else { _adjustTime = 0; }; @@ -89,8 +89,8 @@ if ((_minDeflection != 0 || {_maxDeflection != 0}) && {_profileAdjustedTargetPos }; private _finalAdjustVector = [_yaw, _roll, _pitch]; - TRACE_3("", _pitch, _yaw, _roll); - TRACE_3("", _targetVector, _adjustVector, _finalAdjustVector); + TRACE_3("",_pitch,_yaw,_roll); + TRACE_3("",_targetVector,_adjustVector,_finalAdjustVector); if (accTime > 0) then { private _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 1c964c5113..1f3519f8c9 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -71,14 +71,14 @@ if (isNil "_target") then { if (!isPlayer _shooter) then { // This was an AI shot, lets still guide it on the AI target _target = _shooter getVariable [QGVAR(vanilla_target), nil]; - TRACE_1("Detected AI Shooter!", _target); + TRACE_1("Detected AI Shooter!",_target); } else { private _canUseLock = getNumber (_config >> "canVanillaLock"); // @TODO: Get vanilla target if (_canUseLock > 0 || difficulty < 1) then { private _vanillaTarget = cursorTarget; - TRACE_1("Using Vanilla Locking", _vanillaTarget); + TRACE_1("Using Vanilla Locking",_vanillaTarget); if (!isNil "_vanillaTarget") then { _target = _vanillaTarget; }; diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 7fc30fb30b..bac01d05b4 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -34,12 +34,12 @@ private _losOkay = false; if (_angleOkay) then { _losOkay = [_projectile, _target] call FUNC(checkLos); }; -TRACE_2("", _angleOkay, _losOkay); +TRACE_2("",_angleOkay,_losOkay); // Can't see target, return [0,0,0] and let doSeekerSearch handle it if (!_angleOkay || !_losOkay) exitWith {[0,0,0]}; -TRACE_2("", _target, _foundTargetPos); +TRACE_2("",_target,_foundTargetPos); // @TODO: Configurable lead for seekers private _projectileSpeed = (vectorMagnitude velocity _projectile); private _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index 4b74d0f7e3..a16c58ce5f 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -27,6 +27,6 @@ _laserParams params ["_code", "_wavelengthMin", "_wavelengthMax"]; private _laserResult = [(getPosASL _projectile), (velocity _projectile), _seekerAngle, _seekerMaxRange, [_wavelengthMin, _wavelengthMax], _code, _projectile] call EFUNC(laser,seekerFindLaserSpot); private _foundTargetPos = _laserResult select 0; -TRACE_1("Search", _laserResult); +TRACE_1("Search",_laserResult); _foundTargetPos; diff --git a/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf b/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf index 3356e91c11..663afa2cc7 100644 --- a/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf +++ b/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf @@ -55,7 +55,7 @@ if (_proxyWeaponNeeded || GVAR(useAmmoHandling)) then { }; }; } else { - WARNING_1("unknown mag %1", _xMag); + WARNING_1("unknown mag %1",_xMag); }; }; } forEach (magazinesAllTurrets _mortar); diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index bdc6a9cc40..c391916f19 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -26,7 +26,7 @@ _function = missionNamespace getVariable _function; }; if (_isSingular && {_logicType in _uniqueModulesHandled}) then { //ToDo: should this be an exit? - WARNING_1("Module [%1] - More than 1 singular module placed", _logicType); + WARNING_1("Module [%1] - More than 1 singular module placed",_logicType); }; if (_isSingular) then {_uniqueModulesHandled pushBack _logicType;}; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index aa9c900390..428cf037d5 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -21,7 +21,7 @@ * Public: No */ -TRACE_1("drawName:", _this); +TRACE_1("drawName:",_this); params ["", "_target", "", "_heightOffset"]; diff --git a/addons/nightvision/functions/fnc_onFiredPlayer.sqf b/addons/nightvision/functions/fnc_onFiredPlayer.sqf index 0be73062d2..5bc7ff621e 100644 --- a/addons/nightvision/functions/fnc_onFiredPlayer.sqf +++ b/addons/nightvision/functions/fnc_onFiredPlayer.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; -TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile); +TRACE_7("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if ((!GVAR(running)) || {!GVAR(shutterEffects)} @@ -55,7 +55,7 @@ _visibleFire = _visibleFireCoef * _visibleFire; if (_ammo isKindOf "BulletBase") then { _visibleFire = _visibleFire min 5; // Prevent every shot from triggering with HMG }; -TRACE_1("final", _visibleFire); +TRACE_1("final",_visibleFire); if (_visibleFire <= 1.5) exitWith {}; if ((random (linearConversion [1, 4, GVAR(nvgGeneration), 10, 20])) > _visibleFire) exitWith {}; diff --git a/addons/nightvision/functions/fnc_pfeh.sqf b/addons/nightvision/functions/fnc_pfeh.sqf index ad484d097e..dbd101631c 100644 --- a/addons/nightvision/functions/fnc_pfeh.sqf +++ b/addons/nightvision/functions/fnc_pfeh.sqf @@ -36,7 +36,7 @@ if (EGVAR(common,OldIsCamera)) exitWith { }; }; if (!GVAR(running)) then { - TRACE_1("Un-Pausing", GVAR(paused)); + TRACE_1("Un-Pausing",GVAR(paused)); GVAR(running) = true; [true] call FUNC(setupDisplayEffects); [] call FUNC(refreshGoggleType); diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index 7414e58d02..ccfbd017b6 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -51,7 +51,7 @@ if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) then { if (isArray (_config >> QGVAR(colorPreset))) then {_preset = getArray (_config >> QGVAR(colorPreset));}; }; - TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope, but no good way to detect that) + TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope,but no good way to detect that) private _config = configFile >> "CfgWeapons" >> GVAR(playerHMD); if (!isClass _config) exitWith {}; diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf index ad7622eadd..9628974800 100644 --- a/addons/nlaw/functions/fnc_attackProfile.sqf +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -56,5 +56,5 @@ if ((count _test) > 0) then { }; #endif -// TRACE_1("Adjusted target position", _returnTargetPos); +// TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index 5a1ae0eca0..f36f04d881 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -18,7 +18,7 @@ */ // IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); disableSerialization; diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index df431407da..c7fb19c9c1 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -80,11 +80,11 @@ if (_isPIP) then { // Calculate lighting private _dayOpacity = call EFUNC(common,ambientBrightness); -private _nightOpacity = [1, 0] select (_dayOpacity == 1); +private _nightOpacity = parseNumber (_dayOpacity == 1); // Apply lighting and make layers visible (_display displayCtrl 1713001) ctrlSetTextColor [1, 1, 1, 1]; -(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, [0, 1] select (_dayOpacity < 0.5)]; +(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, parseNumber (_dayOpacity < 0.5)]; (_display displayCtrl 1713005) ctrlSetTextColor [1, 1, 1, _dayOpacity]; (_display displayCtrl 1713006) ctrlSetTextColor [1, 1, 1, _nightOpacity]; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index bbcd9da97f..8f02d734e5 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -20,7 +20,7 @@ if (hasInterface) then { }; ["CBA_settingsInitialized", { - TRACE_1("SettingsInitialized eh", GVAR(enabled)); + TRACE_1("SettingsInitialized eh",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; if (isServer) then { diff --git a/addons/overheating/functions/fnc_firedEH.sqf b/addons/overheating/functions/fnc_firedEH.sqf index 9db3a73dd6..bdb7f864c9 100644 --- a/addons/overheating/functions/fnc_firedEH.sqf +++ b/addons/overheating/functions/fnc_firedEH.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); BEGIN_COUNTER(firedEH); diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index a36eb8bd56..2ef48bf4d9 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); // Retrieve backblast values private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 7a76f4b2be..2345d09327 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); diff --git a/addons/overpressure/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf index 891178cb52..64ee563974 100644 --- a/addons/overpressure/functions/fnc_getDistance.sqf +++ b/addons/overpressure/functions/fnc_getDistance.sqf @@ -19,7 +19,7 @@ */ params ["_posASL", "_direction", "_maxDistance", "_shooter"]; -TRACE_4("params",_posASL,_direction,_maxDistance, _shooter); +TRACE_4("params",_posASL,_direction,_maxDistance,_shooter); private _intersections = lineIntersectsSurfaces [_posASL, _posASL vectorAdd (_direction vectorMultiply _maxDistance), _shooter, objNull, true, 99]; diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index 564a9e09cd..c66d9ff050 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -16,7 +16,7 @@ * Public: No */ params ["_unit", "_parachute"]; -TRACE_2("cutParachute", _unit, _parachute); +TRACE_2("cutParachute",_unit,_parachute); playSound3d ["A3\Sounds_F\characters\parachute\parachute_landing.wss", _unit]; _unit action ["GetOut", _parachute]; diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 47b014f4ab..d4533a7a6b 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -53,8 +53,8 @@ private _TimeText = _display displayCtrl 1001; }; _TimeText ctrlSetText (format ["%1:%2", [_hour, 2] call CBA_fnc_formatNumber, [_minute, 2] call CBA_fnc_formatNumber]); - _HeightText ctrlSetText (format ["%1", floor _height]); - _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); + _HeightText ctrlSetText str floor _height; + _DecendRate ctrlSetText str (_descentRate max 0); (_this select 0) set [1, _height]; (_this select 0) set [2, _curTime]; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index e8fb0f9c6c..999dfc5a2e 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -33,7 +33,7 @@ if (_ammoClass == "" || _magazineClass == "" || _weaponClass == "") exitWith {}; GVAR(controls) = []; for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _control = (__dsp ctrlCreate ["RangeCard_RscText", 790000 + _row]); _control ctrlSetPosition [safeZoneX + 0.183, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.062, 0.025]; if (_row in [0, 8, 18, 28, 38, 48]) then { @@ -47,7 +47,7 @@ for "_row" from 0 to 49 do { }; for "_column" from 0 to 8 do { for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + _column * 100 + _row]); _control ctrlSetPosition [safeZoneX + 0.249 + _column * 0.055, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.052, 0.025]; _control ctrlCommit 0; @@ -57,7 +57,7 @@ for "_column" from 0 to 8 do { }; for "_column" from 0 to 2 do { for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (9 +_column) * 100 + _row]); _control ctrlSetPosition [safeZoneX + 0.743 + _column * 0.049, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.047, 0.025]; _control ctrlCommit 0; @@ -67,7 +67,7 @@ for "_column" from 0 to 2 do { }; for "_column" from 0 to 2 do { for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (12 +_column) * 100 + _row]); _control ctrlSetPosition [safeZoneX + 0.892 + _column * 0.049, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.047, 0.025]; _control ctrlCommit 0; diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index 71802451b7..f41dff6ea9 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -54,7 +54,7 @@ private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMax private _ammoCounts = [_vehicle, _turretPath, _magazineClass] call FUNC(getTurretMagazineAmmo); TRACE_3("start",_magazineClass,_maxMagazines,_ammoCounts); -private _ammoToAdd = if (GVAR(level) == 2) then {_numRounds} else {_rounds}; +private _ammoToAdd = [_rounds, _numRounds] select (GVAR(level) == 2); private _ammoAdded = 0; private _arrayModified = false; // skip needing to remove and re-add mags, if we are only adding new ones diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index 8ffa0eb755..e2a7e3a4a1 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -17,7 +17,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); #define BASE_POWER 0.40 #define BASE_TIME 0.19 diff --git a/addons/refuel/functions/fnc_getCapacity.sqf b/addons/refuel/functions/fnc_getCapacity.sqf index 94681480ae..c6218831da 100644 --- a/addons/refuel/functions/fnc_getCapacity.sqf +++ b/addons/refuel/functions/fnc_getCapacity.sqf @@ -30,7 +30,7 @@ if (isNil "_capacity") then { // Set capacity even if this isn't a fuel source to save on config lookup time in the event this function is used in a loop _source setVariable [QGVAR(capacity), _capacity, true]; // handle weird edge case when trying to run on "camera"/CfgNonAIVehicles which won't support setVariable and will inf-loop - if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1", _this); }; + if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1",_this); }; [_source, _capacity] call FUNC(setFuel); }; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index d071f577a6..1e0147d7e2 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -23,7 +23,7 @@ if !(hasInterface && {GVAR(enabled)}) exitWith {}; params ["_vehicle"]; private _type = typeOf _vehicle; -TRACE_2("addRepairActions", _vehicle,_type); +TRACE_2("addRepairActions",_vehicle,_type); // do nothing if the class is already initialized private _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf index d02ab33fb7..58dd4590bb 100644 --- a/addons/repair/functions/fnc_doRepair.sqf +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -35,7 +35,7 @@ private _hitPointNewDamage = (_hitPointCurDamage - 0.5) max _postRepairDamageMin if (_hitPointNewDamage < _hitPointCurDamage) then { // raise event to set the new hitpoint damage - TRACE_3("repairing main point", _vehicle, _hitPointIndex, _hitPointNewDamage); + TRACE_3("repairing main point",_vehicle,_hitPointIndex,_hitPointNewDamage); [QGVAR(setVehicleHitPointDamage), [_vehicle, _hitPointIndex, _hitPointNewDamage], _vehicle] call CBA_fnc_targetEvent; _hitPointCurDamage = _hitPointNewDamage; }; @@ -57,7 +57,7 @@ if (isArray _hitpointGroupConfig) then { private _subPointCurDamage = _vehicle getHitIndex _hitPointIndex; private _subPointNewDamage = (_subPointCurDamage - 0.5) max _postRepairDamageMin; if (_subPointNewDamage < _subPointCurDamage) then { - TRACE_3("repairing sub point", _vehicle, _subHitIndex, _subPointNewDamage); + TRACE_3("repairing sub point",_vehicle,_subHitIndex,_subPointNewDamage); [QGVAR(setVehicleHitPointDamage), [_vehicle, _subHitIndex, _subPointNewDamage], _vehicle] call CBA_fnc_targetEvent; }; }; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index a970488268..519a3f78d6 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track", _claimedObjects); + ERROR_1("Bad Track",_claimedObjects); }; // can't use a destroyed track diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index d52072b647..a512089c89 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track", _claimedObjects); + ERROR_1("Bad Track",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index 98c3d95cf9..7ec617127c 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_wheel", objNull]]; if ((isNull _wheel) || {!([_unit, _wheel, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - WARNING_1("Bad Claimed Wheel", _claimedObjects); + WARNING_1("Bad Claimed Wheel",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_getHitPointString.sqf b/addons/repair/functions/fnc_getHitPointString.sqf index 5611a6f4e3..93a4c153b2 100644 --- a/addons/repair/functions/fnc_getHitPointString.sqf +++ b/addons/repair/functions/fnc_getHitPointString.sqf @@ -86,7 +86,7 @@ for "_i" from 0 to (count _hitPoint) do { // Don't display part name if no string is found in stringtable if (_text == LSTRING(Hit)) then { - if (_hitPoint != "") then { LOG_1("Hitpoint [%1] - could not be localized", _hitPoint); }; + if (_hitPoint != "") then { LOG_1("Hitpoint [%1] - could not be localized",_hitPoint); }; _text = _textDefault; }; diff --git a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf index d455950a3b..b90e44e8e6 100644 --- a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf +++ b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf @@ -134,7 +134,7 @@ private _processedSelections = []; continue }; - if (ANY_OF(_hitpointGroups, ANY_OF(_x select 1, _x == _hitpoint))) then { // skip child hitpoints + if (ANY_OF(_hitpointGroups,ANY_OF(_x select 1,_x == _hitpoint))) then { // skip child hitpoints TRACE_3("Skipping child hitpoint",_hitpoint,_forEachIndex,_selection); /*#ifdef DEBUG_MODE_FULL systemChat format ["Skipping child hitpoint, hitpoint %1, index %2, selection %3", _hitpoint, _forEachIndex, _selection]; diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf index 1952707204..347c3878d7 100644 --- a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf +++ b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -50,7 +50,7 @@ private _wheelHitPointSelections = []; if ((_wheelBoneNameResized != "") && {_x find _wheelBoneNameResized == 0}) exitWith { // same as above. Requirement for physx. _wheelHitPoint = _hitPoints select _forEachIndex; _wheelHitPointSelection = _hitPointSelections select _forEachIndex; - TRACE_2("wheel found [Orginal]", _wheelName, _wheelHitPoint); + TRACE_2("wheel found [Orginal]",_wheelName,_wheelHitPoint); }; } forEach _hitPointSelections; @@ -83,7 +83,7 @@ private _wheelHitPointSelections = []; if (_bestIndex != -1) then { _wheelHitPoint = _hitPoints select _bestIndex; _wheelHitPointSelection = _hitPointSelections select _bestIndex; - TRACE_2("wheel found [Backup]", _wheelName, _wheelHitPoint); + TRACE_2("wheel found [Backup]",_wheelName,_wheelHitPoint); }; }; }; diff --git a/addons/repair/functions/fnc_isEngineer.sqf b/addons/repair/functions/fnc_isEngineer.sqf index 2a013bccda..2962e4f8ad 100644 --- a/addons/repair/functions/fnc_isEngineer.sqf +++ b/addons/repair/functions/fnc_isEngineer.sqf @@ -22,7 +22,7 @@ private _class = _unit getVariable ["ACE_IsEngineer", _unit getUnitTrait "engine // This if statement is here for copmatability with the common variant of isEngineer, which requires a bool. // We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module. -if (_class isEqualType false) then {_class = [0, 1] select _class}; +if (_class isEqualType false) then {_class = parseNumber _class}; TRACE_3("isEngineer",_unit,_engineerN,_class); if (_class >= _engineerN) exitWith {true}; diff --git a/addons/repair/functions/fnc_isInRepairFacility.sqf b/addons/repair/functions/fnc_isInRepairFacility.sqf index 7ea8ace60f..51cc5424bb 100644 --- a/addons/repair/functions/fnc_isInRepairFacility.sqf +++ b/addons/repair/functions/fnc_isInRepairFacility.sqf @@ -34,7 +34,7 @@ private _checkObject = { private _fnc_check = { private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; - CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position, _position vectorAdd [ARR_3(0, 0, 10)], _unit)]) + CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position,_position vectorAdd [ARR_3(0,0,10)],_unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} }; diff --git a/addons/repair/functions/fnc_normalizeHitPoints.sqf b/addons/repair/functions/fnc_normalizeHitPoints.sqf index 9abeec718c..5e61ef8c88 100644 --- a/addons/repair/functions/fnc_normalizeHitPoints.sqf +++ b/addons/repair/functions/fnc_normalizeHitPoints.sqf @@ -16,10 +16,10 @@ */ params ["_vehicle"]; -TRACE_2("params",_vehicle, typeOf _vehicle); +TRACE_2("params",_vehicle,typeOf _vehicle); // Can't execute all commands if the vehicle isn't local, exit if that's so -if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1", _vehicle);}; +if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1",_vehicle);}; (getAllHitPointsDamage _vehicle) params [["_allHitPoints", []]]; @@ -57,7 +57,7 @@ total = damage _vehicle; // apply normalized damage to all dependand hitpoints { private _damage = call (_dependentHitPointScripts select _forEachIndex); - TRACE_2("setting depend hitpoint", _x, _damage); + TRACE_2("setting depend hitpoint",_x,_damage); _vehicle setHitPointDamage [_x, _damage]; } forEach _dependentHitPoints; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index a86f8f22db..b537963e0f 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -107,7 +107,7 @@ if !(_return && alive _target) exitWith {false}; //Claim required objects { - TRACE_2("Claiming", _x, (typeOf _x)); + TRACE_2("Claiming",_x,(typeOf _x)); [_caller, _x, false] call EFUNC(common,claim); } forEach _claimObjectsAvailable; diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index ce8d29b25d..c305c90b6b 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -51,7 +51,7 @@ if (_weaponSelect != "") then { //Unclaim repair objects: { - TRACE_2("Releasing", _x, (typeOf _x)); + TRACE_2("Releasing",_x,(typeOf _x)); [objNull, _x, false] call EFUNC(common,claim); } forEach _claimedObjects; diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 083daa6cc7..271d662cd4 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -47,7 +47,7 @@ if (_weaponSelect != "") then { //Unclaim repair objects: { - TRACE_2("Releasing", _x, (typeOf _x)); + TRACE_2("Releasing",_x,(typeOf _x)); [objNull, _x, false] call EFUNC(common,claim); } forEach _claimedObjects; diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index 9a28adc211..bfce0e3f5e 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -23,13 +23,13 @@ params ["_vehicle", "_hitPointIndex", "_hitPointDamage", ["_useEffects", false]] TRACE_4("params",_vehicle,typeOf _vehicle,_hitPointIndex,_hitPointDamage); // can't execute all commands if the vehicle isn't local. exit here. -if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1", _vehicle);}; +if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1",_vehicle);}; // get all hitpoints and selections and damages (getAllHitPointsDamage _vehicle) params [["_allHitPoints", []], ["_allHitPointsSelections", []], ["_allHitPointDamages", []]]; // exit if the hitpoint is not valid -if ((_hitPointIndex < 0) || {_hitPointIndex >= (count _allHitPoints)}) exitWith {ERROR_2("NOT A VALID HITPOINT: %1-%2", _hitPointIndex,_vehicle);}; +if ((_hitPointIndex < 0) || {_hitPointIndex >= (count _allHitPoints)}) exitWith {ERROR_2("NOT A VALID HITPOINT: %1-%2",_hitPointIndex,_vehicle);}; // save structural damage and sum of hitpoint damages diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf index f94e14d644..9514966541 100644 --- a/addons/respawn/functions/fnc_handlePlayerChanged.sqf +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -19,9 +19,9 @@ params ["_newUnit"]; private _side = side group _newUnit; -((GETMVAR(ACE_Rallypoint_West, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); -((GETMVAR(ACE_Rallypoint_West_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); -((GETMVAR(ACE_Rallypoint_East, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); -((GETMVAR(ACE_Rallypoint_East_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); -((GETMVAR(ACE_Rallypoint_Independent, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); -((GETMVAR(ACE_Rallypoint_Independent_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); +((GETMVAR(ACE_Rallypoint_West,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == west)); +((GETMVAR(ACE_Rallypoint_West_Base,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == west)); +((GETMVAR(ACE_Rallypoint_East,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == east)); +((GETMVAR(ACE_Rallypoint_East_Base,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == east)); +((GETMVAR(ACE_Rallypoint_Independent,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == independent)); +((GETMVAR(ACE_Rallypoint_Independent_Base,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == independent)); diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index 50931a87f4..7e4651e1e9 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -53,7 +53,7 @@ if (hasInterface) then { private _type = ["selector_selectedFriendly", "selector_selectedEnemy"] select (_respawnMarker == ""); _marker setMarkerTypeLocal _type; - _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init + _marker setMarkerAlphaLocal (parseNumber (_side == playerSide)); // playerSide to guarantee init private _date = _rallypoint getVariable [QGVAR(markerDate), ""]; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index e0823fe6e0..afbc7def86 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -17,7 +17,7 @@ */ params ["_unit", "_allGear", "_activeWeaponAndMuzzle"]; -TRACE_3("restoreGear",_unit, count _allGear, _activeWeaponAndMuzzle); +TRACE_3("restoreGear",_unit,count _allGear,_activeWeaponAndMuzzle); // restore all gear if (!isNil "_allGear") then { diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 86d9848162..f1b8e91bf4 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (!(_ammo isKindOf "BulletBase")) exitWith {}; diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf index 12adfb9f6c..f0b0b7c2f0 100644 --- a/addons/sitting/XEH_clientInit.sqf +++ b/addons/sitting/XEH_clientInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; ["ace_settingsInitialized", { - TRACE_1("SettingInit", XGVAR(enable)); + TRACE_1("SettingInit",XGVAR(enable)); // If not enabled, then do not add CanInteractWith Condition or event handlers if (!XGVAR(enable)) exitWith {}; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 98ece0c62f..2d7cc999da 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -92,7 +92,7 @@ private _seatDistOrig = (getPosASL _player) distance _seat; // Remove PFH if not sitting any more if (isNil {_player getVariable QGVAR(sittingStatus)}) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; - TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(sittingStatus), false)]); + TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(sittingStatus),false)]); }; // Stand up if chair gets deleted or moved diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 87fd40bbbe..9021a92613 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -61,7 +61,7 @@ private _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR get // If interaction menu module is not present, set default duration value if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { _duration = NOINTERACTMENU_DURATION; - INFO_1("Interaction Menu module not present, defaulting duration value to %1",_duration); + INFO_1("Interaction Menu module not present,defaulting duration value to %1",_duration); }; // Add interactions if automatic transitions are disabled, else setup automatic transitions diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index 85804e091f..0f399536f4 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -23,7 +23,7 @@ removeBackpack _unit; private _pos = _unit modelToWorld [0,0,0]; -private _offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; +private _offset = [0.8, 1] select (_unit call CBA_fnc_getUnitAnim select 0 == "prone"); _pos set [0, (_pos select 0) + (sin getDir _unit) * _offset]; _pos set [1, (_pos select 1) + (cos getDir _unit) * _offset]; diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index 4e4310a0cf..aa0ba9fac9 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -45,7 +45,7 @@ if (_intersections isEqualTo []) exitWith { }; (_intersections select 0) params ["_touchingPoint", "_surfaceNormal", "", "_object"]; -TRACE_3("",_touchingPoint, _surfaceNormal, _object); +TRACE_3("",_touchingPoint,_surfaceNormal,_object); // Exit if trying to tag a non static object if ((!isNull _object) && { @@ -93,7 +93,7 @@ private _vectorDirAndUp = if (abs (_v1 select 2) < 0.94) then { [_v1, _v3] }; -TRACE_3("Reference:", _v1, _v2, _v3); +TRACE_3("Reference:",_v1,_v2,_v3); private _fnc_isOk = { params ["_rx", "_ry"]; diff --git a/addons/towing/CfgVehicles.hpp b/addons/towing/CfgVehicles.hpp index df791d95d3..6775a8c9e2 100644 --- a/addons/towing/CfgVehicles.hpp +++ b/addons/towing/CfgVehicles.hpp @@ -1,84 +1,61 @@ -#define TOW_ACTION \ -class ACE_Actions {\ - class ACE_MainActions {\ - class ADDON {\ - displayName = CSTRING(displayName);\ - distance = TOW_ACTION_DISTANCE;\ - condition = QUOTE([ARR_1(_target)] call FUNC(isSuitableSimulation));\ - statement = "";\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - showDisabled = 0;\ - icon = "";\ - class GVAR(startTow3) {\ - displayName = CSTRING(start3);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope3')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope3')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow6) {\ - displayName = CSTRING(start6);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope6')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope6')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow12) {\ - displayName = CSTRING(start12);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope12')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope12')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow15) {\ - displayName = CSTRING(start15);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope15')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope15')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow18) {\ - displayName = CSTRING(start18);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope18')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope18')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow27) {\ - displayName = CSTRING(start27);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope27')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope27')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow36) {\ - displayName = CSTRING(start36);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope36')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope36')] call FUNC(startTow));\ +#define CONCAT(a,b) a##b +#define TOW_ACTION(length) \ + class GVAR(CONCAT(startTow,length)) {\ + displayName = CSTRING(CONCAT(start,length));\ + condition = QUOTE([ARR_2(_player,'CONCAT(ACE_rope,length)')] call DEFUNC(common,hasItem));\ + statement = QUOTE([ARR_3(_player,_target,'CONCAT(ACE_rope,length)')] call DFUNC(startTow));\ + exceptions[] = { INTERACTION_EXCEPTIONS };\ + } +#define TOW_ACTIONS \ + class ACE_Actions {\ + class ACE_MainActions {\ + class ADDON {\ + displayName = CSTRING(displayName);\ + distance = TOW_ACTION_DISTANCE;\ + condition = QUOTE(alive _target && {_target call DFUNC(isSuitableSimulation)});\ exceptions[] = { INTERACTION_EXCEPTIONS };\ + insertChildren = QUOTE(_target call DFUNC(getDetachActions));\ + TOW_ACTION(3);\ + TOW_ACTION(6);\ + TOW_ACTION(12);\ + TOW_ACTION(15);\ + TOW_ACTION(18);\ + TOW_ACTION(27);\ + TOW_ACTION(36);\ };\ };\ - };\ -} + } class CfgVehicles { class LandVehicle; class Car: LandVehicle { - TOW_ACTION; + TOW_ACTIONS; }; class Tank: LandVehicle { - TOW_ACTION; + TOW_ACTIONS; + }; + + class Ship; + class Ship_F: Ship { + TOW_ACTIONS; }; class ThingX; - class GVAR(hook): ThingX { - displayName = "hook"; // not publicly visible, no stringtable needed + class GVAR(helper): ThingX { + displayName = "helper"; // not publicly visible, no stringtable needed scope = 1; scopeCurator = 1; - model = "\a3\Structures_F_Orange\VR\Helpers\Sign_sphere10cm_Geometry_F.p3d"; + model = "\A3\Weapons_f\empty"; destrType = "DestructNo"; - + }; + class GVAR(hook): GVAR(helper) { + displayName = "hook"; class ACE_Actions { class ACE_MainActions { displayName = CSTRING(detach); - condition = "true"; - statement = QUOTE(private _parent = _target getVariable [ARR_2(QQGVAR(parent),objNull)]; private _child = _target getVariable [ARR_2(QQGVAR(child),objNull)]; [ARR_3(_player,_parent,_child)] call FUNC(detach)); - distance = 2; + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(detachRope)); + distance = TOW_ACTION_DISTANCE; }; }; }; diff --git a/addons/towing/XEH_PREP.hpp b/addons/towing/XEH_PREP.hpp index d26b29e5f0..b72f70c55b 100644 --- a/addons/towing/XEH_PREP.hpp +++ b/addons/towing/XEH_PREP.hpp @@ -1,7 +1,9 @@ PREP(addRopeToVehicle); PREP(attachRopePFH); -PREP(canStartTow); -PREP(detach); +PREP(attachVehicles); +PREP(detachChild); +PREP(detachRope); +PREP(getDetachActions); PREP(isSuitableSimulation); PREP(onMouseButtonDown); PREP(onMouseButtonUp); diff --git a/addons/towing/XEH_postInit.sqf b/addons/towing/XEH_postInit.sqf index 187af19244..01c7d6e48e 100644 --- a/addons/towing/XEH_postInit.sqf +++ b/addons/towing/XEH_postInit.sqf @@ -1,14 +1,40 @@ #include "script_component.hpp" -["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler; + ["MouseButtonUp", LINKFUNC(onMouseButtonUp)] call CBA_fnc_addDisplayHandler; GVAR(mouseLeft) = false; GVAR(mouseRight) = false; GVAR(blockFireEHID) = -1; -GVAR(cancel) = false; -GVAR(canAttach) = false; - -[QGVAR(setTowParent), { - params ["_parent", "_child"]; - _child setTowParent _parent; +[QGVAR(ropeAttachTo), { + params ["_child", "_relativeAttachPos", "_rope", "_helper"]; + TRACE_4("ropeAttachTo",_child,_relativeAttachPos,_rope,_helper); + _helper ropeDetach _rope; + [_child, _relativeAttachPos] ropeAttachTo _rope; + deleteVehicle _helper; }] call CBA_fnc_addEventHandler; + +[QGVAR(attachVehicles), LINKFUNC(attachVehicles)] call CBA_fnc_addEventHandler; +[QGVAR(detachChild), LINKFUNC(detachChild)] call CBA_fnc_addEventHandler; + +if (!isServer) exitWith {}; + +[QGVAR(cleanupParent), { + params ["_parent"]; + TRACE_1("cleanupParent",_parent); + _parent removeEventHandler ["RopeBreak", _parent getVariable [QGVAR(RopeBreakEHID), -1]]; + _parent setVariable [QGVAR(RopeBreakEHID), -1]; + private _parentParentHooks = _parent getVariable [QGVAR(parentHooks), []]; + if (_parentParentHooks isEqualTo []) then { + TRACE_1("remove Deleted EH",_parent); + _parent removeEventHandler ["Deleted", _parent getVariable [QGVAR(DeletedEHID), -1]]; + _parent setVariable [QGVAR(DeletedEHID), -1]; + }; +}] call CBA_fnc_addEventHandler; + +addMissionEventHandler ["PlayerConnected", { + if (GVAR(allChildren) isEqualTo []) exitWith {}; + params ["", "", "", "_jip", "_owner"]; + if (!_jip) exitWith {}; + TRACE_2("pushing children",_owner,GVAR(allChildren)); + [QGVAR(setTowParentAllChildren), [GVAR(allChildren)], _owner] call CBA_fnc_ownerEvent; +}]; diff --git a/addons/towing/XEH_preInit.sqf b/addons/towing/XEH_preInit.sqf index 894773534a..6a85ba442f 100644 --- a/addons/towing/XEH_preInit.sqf +++ b/addons/towing/XEH_preInit.sqf @@ -8,4 +8,20 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" +// handle JIP +if (isServer) then { + GVAR(allChildren) = []; +} else { + // can't use CBA EH in postInit because too late for server PlayerConnected EH + [QGVAR(setTowParentAllChildren), { + params ["_children"]; + TRACE_1("setTowParentAllChildren",_children); + { + private _parent = _x getVariable QGVAR(parent); + TRACE_2("setTowParent",_x,_parent); + _x setTowParent _parent; + } forEach _children; + }] call CBA_fnc_addEventHandler; +}; + ADDON = true; diff --git a/addons/towing/functions/fnc_addRopeToVehicle.sqf b/addons/towing/functions/fnc_addRopeToVehicle.sqf index 4ff0fce62d..9dec1257d0 100644 --- a/addons/towing/functions/fnc_addRopeToVehicle.sqf +++ b/addons/towing/functions/fnc_addRopeToVehicle.sqf @@ -20,8 +20,8 @@ params ["_vehicle"]; if (0 == getNumber (configOf _vehicle >> QEGVAR(cargo,hasCargo))) exitWith {}; -private _ropeType = if ( +private _ropeType = ["ACE_rope6", "ACE_rope12"] select ( -1 < ["Tank", "Wheeled_APC_F", "Truck_F"] findIf {_vehicle isKindOf _x} -) then {"ACE_rope12"} else {"ACE_rope6"}; +); _vehicle addItemCargoGlobal [_ropeType, 1]; diff --git a/addons/towing/functions/fnc_attachRopePFH.sqf b/addons/towing/functions/fnc_attachRopePFH.sqf index e8336ecc25..37f626e0a9 100644 --- a/addons/towing/functions/fnc_attachRopePFH.sqf +++ b/addons/towing/functions/fnc_attachRopePFH.sqf @@ -40,13 +40,32 @@ if (_intersections isNotEqualTo []) then { _intersectionToUse params ["_intersectPosition", "", "_intersectObject"]; - // if we have a target object, we assume we are attaching to the parent. If no target object, we are attaching to child - GVAR(canAttach) = (_intersectObject isNotEqualTo _ignoreParent) && { (!isNull _target && { _intersectObject isEqualTo _target }) || { isNull _target && { [_intersectObject] call FUNC(isSuitableSimulation) }}} && { !(_intersectObject getVariable [QGVAR(towing), false]) }; + GVAR(canAttach) = + _intersectObject isNotEqualTo _ignoreParent + && { + // if we have a target object, we assume we are attaching to the parent. If no target object, we are attaching to child + if (!isNull _target) then { + _intersectObject isEqualTo _target + } else { + [_intersectObject] call FUNC(isSuitableSimulation) + && { // ignore _intersectObject which has parent != _ignoreParent + private _intersectObjectParent = _intersectObject getVariable [QGVAR(parent), objNull]; + isNull _intersectObjectParent || {_intersectObjectParent == _ignoreParent} + } && { // arma prevents making rings (ropeAttachTo silently fails) + private _ancestor = _ignoreParent getVariable [QGVAR(parent), objNull]; + while {!isNull _ancestor && {_ancestor != _intersectObject}} do { + _ancestor = _ancestor getVariable [QGVAR(parent), objNull]; + }; + isNull _ancestor + } + } + } + ; if (GVAR(canAttach)) then { - TRACE_4("can attach",_target,_intersectObject,_ignoreParent,_ignoreRope); + // TRACE_4("can attach",_target,_intersectObject,_ignoreParent,_ignoreRope); GVAR(attachHelper) setPosASL _intersectPosition; - _hintLMB = localize LSTRING(attach); + _hintLMB = LLSTRING(attach); GVAR(attachHelper) setVariable [QGVAR(object), _intersectObject]; }; @@ -76,4 +95,3 @@ if (_hint isNotEqualTo (_unit getVariable [QGVAR(hint), []])) then { _unit setVariable [QGVAR(hint), _hint]; _hint call EFUNC(interaction,showMouseHint); }; - diff --git a/addons/towing/functions/fnc_attachVehicles.sqf b/addons/towing/functions/fnc_attachVehicles.sqf new file mode 100644 index 0000000000..9fd95f3742 --- /dev/null +++ b/addons/towing/functions/fnc_attachVehicles.sqf @@ -0,0 +1,65 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Attaches child to parent vehicle. + * Run globally. + * + * Arguments: + * 0: Vehicle to tow from + * 1: Vehicle to tow + * 2: Rope End Position + * 3: Rope + * 4: Attached Helper Object + * + * Return Value: + * None + * + * Example: + * [parent, cursorObject, [0,0,0], ropes parent select 0] call ace_towing_fnc_attachVehicles + * + * Public: No + */ +params ["_parent", "_child", "_relativeAttachPos", "_rope", "_helper"]; +TRACE_5("attachVehicles",_parent,_child,_relativeAttachPos,_rope,_helper); + +if (local _parent) then { + _helper ropeDetach _rope; + [_child, _relativeAttachPos] ropeAttachTo _rope; + deleteVehicle _helper; +}; + +_child setTowParent _parent; +if (!isServer) exitWith {}; + +_child setVariable [QGVAR(parent), _parent, true]; +GVAR(allChildren) pushBack _child; + +{ + if (-1 == _x getVariable [QGVAR(DeletedEHID), -1]) then { + _x setVariable [QGVAR(DeletedEHID), _x addEventHandler ["Deleted", { + params ["_entity"]; + private _childHooks = _entity getVariable [QGVAR(childHooks), []]; + private _parentHooks = _entity getVariable [QGVAR(parentHooks), []]; + TRACE_3("Deleted EH",_entity,_childHooks,_parentHooks); + { + [objNull, _x, _entity] call FUNC(detachRope); + } forEach (_childHooks + _parentHooks); + if (_childHooks isNotEqualTo []) then { // only for parent + // because deleting lasts for several frames we have to delete RB EH to fix double cleanup + _entity removeEventHandler ["RopeBreak", _entity getVariable QGVAR(RopeBreakEHID)]; + }; + }]]; + }; +} forEach [_parent, _child]; + +if (-1 == _parent getVariable [QGVAR(RopeBreakEHID), -1]) then { + _parent setVariable [QGVAR(RopeBreakEHID), _parent addEventHandler ["RopeBreak", { + params ["_parent", "_rope", "_child"]; + if (isNull _rope) exitWith {}; // happens + private _hook = _rope getVariable [QGVAR(hook), objNull]; + private _hookChild = _hook getVariable [QGVAR(vars), []] param [1, objNull]; + if (isNull _hook || {_child != _hookChild}) exitWith {}; // handle helper detach + TRACE_4("RopeBreak EH",_parent,_rope,_child,_hook); + [objNull, _hook] call FUNC(detachRope); + }]]; +}; diff --git a/addons/towing/functions/fnc_canStartTow.sqf b/addons/towing/functions/fnc_canStartTow.sqf deleted file mode 100644 index 1ffca3df86..0000000000 --- a/addons/towing/functions/fnc_canStartTow.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Condition for whether or not we can tow from this object - * - * Arguments: - * 0: Unit wanting to start towing - * 1: Vehicle to tow from - * - * Return Value: - * Whether or not we can start towing - * - * Example: - * [player, cursorObject] call ace_towing_fnc_canStartTow - * - * Public: No - */ -params ["_unit", "_target"]; -private _isTowing = _target getVariable [QGVAR(towing), false]; -TRACE_1("is towing",_isTowing); -!_isTowing diff --git a/addons/towing/functions/fnc_detach.sqf b/addons/towing/functions/fnc_detach.sqf deleted file mode 100644 index 92494eae0e..0000000000 --- a/addons/towing/functions/fnc_detach.sqf +++ /dev/null @@ -1,48 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Detaches child from parent, and gives rope item back - * - * Arguments: - * 0: Parent - * 1: Child - * - * Return Value: - * None - * - * Example: - * [player, cursorObject] call ace_towing_fnc_detach - * - * Public: No - */ -params ["_unit", "_parent", "_child"]; -TRACE_3("detach",_unit,_parent,_child); - -private _hook = _child getVariable [QGVAR(hook), objNull]; - -_parent removeEventHandler ["Deleted", _hook getVariable QGVAR(parentDeleteEventHandler)]; -_hook setVariable [QGVAR(parentDeleteEventHandler), -1]; - -_child removeEventHandler ["Deleted", _hook getVariable QGVAR(childDeleteEventHandler)]; -_hook setVariable [QGVAR(childDeleteEventHandler), -1]; - -_parent removeEventHandler ["RopeBreak", _parent getVariable QGVAR(ropeBreakEventHandler)]; -_parent setVariable [QGVAR(ropeBreakEventHandler), -1]; - -private _rope = _child getVariable [QGVAR(rope), objNull]; -ropeDestroy _rope; - -private _ropeClass = _hook getVariable [QGVAR(ropeClass), ""]; -deleteVehicle _hook; - -TRACE_1("rope",_ropeClass); - -if (_ropeClass isNotEqualTo "") then { - [_unit, _ropeClass, true] call CBA_fnc_addItem; -}; - -[QGVAR(setTowParent), [objNull, _child], _child] call CBA_fnc_targetEvent; - -_child setVariable [QGVAR(towing), false, true]; -_parent setVariable [QGVAR(towing), false, true]; - diff --git a/addons/towing/functions/fnc_detachChild.sqf b/addons/towing/functions/fnc_detachChild.sqf new file mode 100644 index 0000000000..a30f90d8c6 --- /dev/null +++ b/addons/towing/functions/fnc_detachChild.sqf @@ -0,0 +1,33 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Detaches child. + * Run globally. + * + * Arguments: + * 0: Child + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_towing_fnc_detachChild + * + * Public: No + */ +params ["_child"]; +TRACE_1("detachChild",_child); + +_child setTowParent objNull; + +if (!isServer) exitWith {}; + +_child setVariable [QGVAR(parent), objNull, true]; +GVAR(allChildren) = GVAR(allChildren) - [_child]; + +private _childChildHooks = _child getVariable [QGVAR(childHooks), []]; +if (_childChildHooks isEqualTo []) then { + TRACE_1("remove Deleted EH",_child); + _child removeEventHandler ["Deleted", _child getVariable [QGVAR(DeletedEHID), -1]]; + _child setVariable [QGVAR(DeletedEHID), -1]; +}; diff --git a/addons/towing/functions/fnc_detachRope.sqf b/addons/towing/functions/fnc_detachRope.sqf new file mode 100644 index 0000000000..8baed5532d --- /dev/null +++ b/addons/towing/functions/fnc_detachRope.sqf @@ -0,0 +1,60 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Detaches rope of given hook and gives rope item back. + * + * Arguments: + * 0: Player + * 1: Rope Hook + * 2: Deleted object (default: objNull) + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_towing_fnc_detachRope + * + * Public: No + */ +params ["_unit", "_hook", ["_deletedObject", objNull]]; + +private _hookVars = _hook getVariable QGVAR(vars); +if (isNil "_hookVars") then { // this is hookParent + _hook = _hook getVariable QGVAR(hook); + _hookVars = _hook getVariable QGVAR(vars); +}; + +_hookVars params ["_parent", "_child", "_rope", "_ropeClass", "_hookParent"]; + +TRACE_8("detachRope",_unit,_parent,_child,_hook,_hookParent,_rope,_ropeClass,_deletedObject); + +ropeDestroy _rope; // can run on client + +if (!isNull _unit && {_ropeClass isNotEqualTo ""}) then { + [_unit, _ropeClass, true] call CBA_fnc_addItem; +}; + +{ + detach _x; + deleteVehicle _x; +} forEach [_hook, _hookParent]; + +// cleanup object variables and EHs only if function isn't called from Deleted EH +if (isNull _deletedObject || {_parent isNotEqualTo _deletedObject}) then { + private _parentChildHooks = _parent getVariable [QGVAR(childHooks), []]; + _parentChildHooks = _parentChildHooks - [_hook]; + _parent setVariable [QGVAR(childHooks), _parentChildHooks, true]; + + if (_parentChildHooks isEqualTo []) then { + [QGVAR(cleanupParent), _parent] call CBA_fnc_serverEvent; + }; +}; +if (isNull _deletedObject || {_child isNotEqualTo _deletedObject}) then { + private _childParentHooks = _child getVariable [QGVAR(parentHooks), []]; + _childParentHooks = _childParentHooks - [_hook]; + _child setVariable [QGVAR(parentHooks), _childParentHooks, true]; + + if (_childParentHooks isEqualTo []) then { + [QGVAR(detachChild), _child] call CBA_fnc_globalEvent; + }; +}; diff --git a/addons/towing/functions/fnc_getDetachActions.sqf b/addons/towing/functions/fnc_getDetachActions.sqf new file mode 100644 index 0000000000..4f86220797 --- /dev/null +++ b/addons/towing/functions/fnc_getDetachActions.sqf @@ -0,0 +1,40 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Creates vehicle detach actions for attached ropes. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Detach actions + * + * Example: + * cursorObject call ace_towing_fnc_getDetachActions + * + * Public: No + */ +params ["_vehicle"]; + +private _statement = { + params ["", "_player", "_hook"]; + [_player, _hook] call FUNC(detachRope); +}; + +private _parentHooks = _vehicle getVariable [QGVAR(parentHooks), []]; +private _childHooks = _vehicle getVariable [QGVAR(childHooks), []]; + +(_parentHooks + _childHooks) apply { + private _hook = _x; + _hook getVariable QGVAR(vars) params ["_hookParent", "_hookChild"]; + private _partner = [_hookParent, _hookChild] select (_vehicle == _hookParent); + private _partnerName = getText (configOf _partner >> "displayName"); + private _partnerOwnerName = [_partner, true] call EFUNC(common,getName); + if (_partnerOwnerName != "") then { + _partnerName = format ["%1, %2", _partnerName, _partnerOwnerName]; + }; + private _name = format ["%1 (%2)", LLSTRING(detach), _partnerName]; + private _icon = [_partner] call EFUNC(common,getVehicleIcon); + private _action = [format ["%1", _hook], _name, _icon, _statement, {true}, {}, _hook] call EFUNC(interact_menu,createAction); + [_action, [], _vehicle] +} diff --git a/addons/towing/functions/fnc_isSuitableSimulation.sqf b/addons/towing/functions/fnc_isSuitableSimulation.sqf index c808dc20c4..6df9c3d40e 100644 --- a/addons/towing/functions/fnc_isSuitableSimulation.sqf +++ b/addons/towing/functions/fnc_isSuitableSimulation.sqf @@ -19,8 +19,7 @@ params ["_target"]; // need toLower since apparently this isn't case sensitive private _simulationType = getText ((configOf _target) >> "simulation"); -TRACE_1("sim type",_simulationType); +// TRACE_1("sim type",_simulationType); // Biki lies, you can both tow and tow as either TankX or CarX -(toLower _simulationType) in ["tankx", "carx"] - +(toLower _simulationType) in ["tankx", "carx", "shipx"] diff --git a/addons/towing/functions/fnc_startTow.sqf b/addons/towing/functions/fnc_startTow.sqf index fa70d91cff..33cee1cb7b 100644 --- a/addons/towing/functions/fnc_startTow.sqf +++ b/addons/towing/functions/fnc_startTow.sqf @@ -32,5 +32,6 @@ GVAR(isSwimming) = _unit call EFUNC(common,isSwimming); GVAR(putWeaponAwayNextFrame) = false; GVAR(cancel) = false; GVAR(canAttach) = false; +GVAR(onMouseButtonDownEHID) = ["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler; [LINKFUNC(towStateMachinePFH), 0, [TOW_STATE_ATTACH_PARENT, _unit, _target, objNull, _ropeLength, _ropeClass]] call CBA_fnc_addPerFrameHandler; [QGVAR(ropeDeployed), [_unit, _target, _ropeClass]] call CBA_fnc_localEvent; diff --git a/addons/towing/functions/fnc_towStateMachinePFH.sqf b/addons/towing/functions/fnc_towStateMachinePFH.sqf index 0adcce76e6..c3b7e19720 100644 --- a/addons/towing/functions/fnc_towStateMachinePFH.sqf +++ b/addons/towing/functions/fnc_towStateMachinePFH.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Called per frame. Handles current unit state for attaching a rope to two vehicles + * Called per frame. Handles current unit state for attaching a rope to two vehicles. * * Arguments: * 0: PFEH Args @@ -62,14 +62,16 @@ if (_exitCondition && {_state < TOW_STATE_CANCEL}) then { switch (_state) do { case TOW_STATE_ATTACH_PARENT: { - TRACE_2("state attach parent",_unit,_parent); + // TRACE_2("state attach parent",_unit,_parent); [_unit, _parent, objNull, objNull, [0, 0, 0], _length] call FUNC(attachRopePFH); if (GVAR(canAttach) && { GVAR(mouseLeft) }) then { _args set [0, TOW_STATE_ATTACH_CHILD]; - _rope = ropeCreate [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper), _length]; - [GVAR(attachHelper), [0, 0, 0]] ropeAttachTo _rope; - + // can't use unit hand because rope doesn't change position when hand moving + // can't use createVehicleLocal because rope can be non-local (like parent) and it must be attached to global vehicle + GVAR(helper) = createVehicle [QGVAR(helper), [0, 0, 0], [], 0, "CAN_COLLIDE"]; + GVAR(helper) attachTo [_unit, [0, 0, 0], "LeftHand", true]; + _rope = ropeCreate [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper), GVAR(helper), [0, 0, 0], _length]; _args set [3, _rope]; }; @@ -79,7 +81,7 @@ switch (_state) do { }; }; case TOW_STATE_ATTACH_CHILD: { - TRACE_3("state attach child",_unit,_parent,_rope); + // TRACE_3("state attach child",_unit,_parent,_rope); [_unit, objNull, _parent, _rope, getPosASLVisual _rope, _length] call FUNC(attachRopePFH); if (GVAR(canAttach) && { GVAR(mouseLeft) }) then { @@ -108,60 +110,42 @@ switch (_state) do { GVAR(cancel) = false; }; - [QGVAR(setTowParent), [_parent, _child], _parent] call CBA_fnc_targetEvent; + detach GVAR(helper); + // can't delete GVAR(helper) without ropeDetach which requires local rope (==parent), so pass it to owner + if (isNull (_child getVariable [QGVAR(parent), objNull])) then { + [QGVAR(attachVehicles), [_parent, _child, _relativeAttachPos, _rope, GVAR(helper)]] call CBA_fnc_globalEvent; + } else { + [QGVAR(ropeAttachTo), [_child, _relativeAttachPos, _rope, GVAR(helper)], _parent] call CBA_fnc_targetEvent; + }; - GVAR(attachHelper) ropeDetach _rope; - [_child, _relativeAttachPos] ropeAttachTo _rope; + private _hookParent = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; + _hookParent attachTo [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual _rope]; - private _hook = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "NONE"]; + private _hook = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _hook attachTo [_child, _relativeAttachPos]; - _hook setVariable [QGVAR(parent), _parent, true]; - _hook setVariable [QGVAR(child), _child, true]; - _child setVariable [QGVAR(rope), _rope, true]; - _child setVariable [QGVAR(hook), _hook, true]; + // use array to decrease public setVar count + private _hookVars = [_parent, _child, _rope, _ropeClass, _hookParent]; + _hook setVariable [QGVAR(vars), _hookVars, true]; - _parent setVariable [QGVAR(hook), _hook, true]; + _hookParent setVariable [QGVAR(hook), _hook, true]; + _rope setVariable [QGVAR(hook), _hook, true]; - _hook setVariable [QGVAR(ropeClass), _ropeClass, true]; + private _childParentHooks = _child getVariable [QGVAR(parentHooks), []]; + _childParentHooks pushBack _hook; + _child setVariable [QGVAR(parentHooks), _childParentHooks, true]; - _child setVariable [QGVAR(towing), true, true]; - _parent setVariable [QGVAR(towing), true, true]; - - _hook setVariable [QGVAR(parentDeleteEventHandler), _parent addEventHandler ["Deleted", { - params ["_entity"]; - - private _hook = _entity getVariable [QGVAR(hook), objNull]; - private _child = _hook getVariable [QGVAR(child), objNull]; - private _parent = _hook getVariable [QGVAR(parent), objNull]; - - [objNull, _parent, _child] call FUNC(detach); - }], true]; - - _hook setVariable [QGVAR(childDeleteEventHandler), _child addEventHandler ["Deleted", { - params ["_entity"]; - - private _hook = _entity getVariable [QGVAR(hook), objNull]; - private _child = _hook getVariable [QGVAR(child), objNull]; - private _parent = _hook getVariable [QGVAR(parent), objNull]; - - [objNull, _parent, _child] call FUNC(detach); - }], true]; - - _parent setVariable [QGVAR(ropeBreakEventHandler), _parent addEventHandler ["RopeBreak", { - params ["_parent", "_rope", "_child"]; - - [objNull, _parent, _child] call FUNC(detach); - - _parent removeEventHandler ["RopeBreak", _parent getVariable QGVAR(ropeBreakEventHandler)]; - _parent setVariable [QGVAR(ropeBreakEventHandler), -1]; - }], true]; + private _parentChildHooks = _parent getVariable [QGVAR(childHooks), []]; + _parentChildHooks pushBack _hook; + _parent setVariable [QGVAR(childHooks), _parentChildHooks, true]; _args set [0, TOW_STATE_CLEANUP]; }; case TOW_STATE_CANCEL: { TRACE_1("state cancel",_rope); if !(isNull _rope) then { + detach GVAR(helper); + deleteVehicle GVAR(helper); ropeDestroy _rope; }; [_unit, _ropeClass, true] call CBA_fnc_addItem; @@ -174,6 +158,7 @@ switch (_state) do { TRACE_2("state cleanup",GVAR(attachHelper),_handle); deleteVehicle GVAR(attachHelper); [_handle] call CBA_fnc_removePerFrameHandler; + ["MouseButtonDown", GVAR(onMouseButtonDownEHID)] call CBA_fnc_removeDisplayHandler; _unit setVariable [QGVAR(hint), []]; call EFUNC(interaction,hideMouseHint); if (GVAR(blockFireEHID) != -1) then { diff --git a/addons/towing/initSettings.inc.sqf b/addons/towing/initSettings.inc.sqf index 03d20781cb..dbfe326d4c 100644 --- a/addons/towing/initSettings.inc.sqf +++ b/addons/towing/initSettings.inc.sqf @@ -7,7 +7,8 @@ { if !(_this && {isServer} && {isNil QGVAR(addRopeToVehicleInventory_initialized)}) exitWith {}; GVAR(addRopeToVehicleInventory_initialized) = true; - ["Tank", "initPost", LINKFUNC(addRopeToVehicle), true, [], true] call CBA_fnc_addClassEventHandler; - ["Car", "initPost", LINKFUNC(addRopeToVehicle), true, [], true] call CBA_fnc_addClassEventHandler; + { + [_x, "initPost", LINKFUNC(addRopeToVehicle), true, [], true] call CBA_fnc_addClassEventHandler; + } forEach ["Car", "Ship", "Tank"]; } ] call CBA_fnc_addSetting; diff --git a/addons/towing/script_component.hpp b/addons/towing/script_component.hpp index 2d9790ac20..c52e84046e 100644 --- a/addons/towing/script_component.hpp +++ b/addons/towing/script_component.hpp @@ -24,4 +24,3 @@ #define TOW_STATE_ATTACH 2 #define TOW_STATE_CANCEL 3 #define TOW_STATE_CLEANUP 4 - diff --git a/addons/trenches/functions/fnc_blockTrench_place.sqf b/addons/trenches/functions/fnc_blockTrench_place.sqf index f602a871e0..4c0a218307 100644 --- a/addons/trenches/functions/fnc_blockTrench_place.sqf +++ b/addons/trenches/functions/fnc_blockTrench_place.sqf @@ -63,10 +63,10 @@ private _east = (abs (_ax - _bx)) >= (abs (_ay - _by)); private _origin2D = []; private _length = 0; if (_east) then { - _origin2D = if (_ax < _bx) then { _start2d } else { _end2d }; + _origin2D = [_end2d, _start2d] select (_ax < _bx); _length = (abs (_ax - _bx)) / _cellsize; } else { - _origin2D = if (_ay < _by) then { _start2d } else { _end2d }; + _origin2D = [_end2d, _start2d] select (_ay < _by); _length = (abs (_ay - _by)) / _cellsize; }; TRACE_3("",_east,_origin2D,_length); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 3771bf840b..6751d9700c 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -68,7 +68,7 @@ if (!_force) then { }; private _displays = ((uiNamespace getVariable "IGUI_displays") + [findDisplay IDD_MISSION]) select {_idd == ctrlIDD _x}; -private _fade = [1, 0] select _show; +private _fade = parseNumber !_show; // Disable/Enable elements private _success = false; diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index ffd64cc77f..3697ff2cf9 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -103,7 +103,7 @@ if (isNil "_eh") then { // Maybe its overridden somewhere else, but this makes sure it is the last one [{ params ["_vehicle"]; - TRACE_1("EH not added yet - added eh now", _vehicle); + TRACE_1("EH not added yet - added eh now",_vehicle); private _hd = _vehicle addEventHandler ["HandleDamage", { _this call FUNC(handleDamage) }]; _vehicle setVariable [QGVAR(handleDamage), _hd]; }, [_vehicle]] call CBA_fnc_execNextFrame; diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index ed05a171d4..72a10577f5 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -248,7 +248,7 @@ switch (_hitArea) do { }; { - TRACE_1("doing damage to hitpoint", _x); + TRACE_1("doing damage to hitpoint",_x); [_vehicle, -1, _x, 1 * _penChance] call FUNC(addDamage); } forEach _partKill; @@ -270,7 +270,7 @@ switch (_hitArea) do { }; if (0.8 * _ammoEffectiveness > random 1) then { - TRACE_1("damaged turret", _ammoEffectiveness * 0.8); + TRACE_1("damaged turret",_ammoEffectiveness * 0.8); [_vehicle, _hitIndex, _hitpointName, 1 * _penChance] call FUNC(addDamage); _vehicle setVariable [QGVAR(canShoot), false]; }; diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 03562a6180..f8ccc59a0f 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -37,10 +37,10 @@ if (GVAR(LockVehicleInventory) && //if setting not enabled !isNull (findDisplay 602) }, { - TRACE_1("car display open: closing", _this); + TRACE_1("car display open: closing",_this); (findDisplay 602) closeDisplay 0; [{ - TRACE_1("Opening Player Inventory", _this); + TRACE_1("Opening Player Inventory",_this); ACE_player action ["Gear", objNull]; }, []] call CBA_fnc_execNextFrame; }, []] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index c34dbb78e2..7b99f093a7 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -20,5 +20,5 @@ params ["_veh", "_isLocked"]; TRACE_2("params",_veh,_isLocked); private _lockNumber = [0, 2] select _isLocked; -TRACE_2("Setting Lock State", _veh, _lockNumber); +TRACE_2("Setting Lock State",_veh,_lockNumber); _veh lock _lockNumber; diff --git a/addons/viewports/dev/debugPoints.sqf b/addons/viewports/dev/debugPoints.sqf index 24b393d70f..53fe016b62 100644 --- a/addons/viewports/dev/debugPoints.sqf +++ b/addons/viewports/dev/debugPoints.sqf @@ -22,7 +22,7 @@ #define IDD_3DEN 313 [] spawn { - INFO_2("Pre-Init [is3den %1][3den display: %2]", is3den, !isNull findDisplay IDD_3DEN); + INFO_2("Pre-Init [is3den %1][3den display: %2]",is3den,!isNull findDisplay IDD_3DEN); if (!is3den) exitWith {}; GVAR(3denIndex) = 0; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index 4856a7b738..ffe289a589 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (_weapon != "Throw") exitWith {}; diff --git a/addons/weather/functions/fnc_displayAirTemp.sqf b/addons/weather/functions/fnc_displayAirTemp.sqf index 4eb5bdf3ac..08b325dcac 100644 --- a/addons/weather/functions/fnc_displayAirTemp.sqf +++ b/addons/weather/functions/fnc_displayAirTemp.sqf @@ -17,7 +17,7 @@ */ params ["_apparent_temperature", "_bias"]; -TRACE_2("displayAirTemp",_apparent_temperature, _bias); +TRACE_2("displayAirTemp",_apparent_temperature,_bias); private _temperature1 = floor(_apparent_temperature + (_bias select 0) - (random 2)); private _temperature2 = floor(_apparent_temperature + (_bias select 1) + (random 2)); diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index d7c45e595a..23a87ecbf4 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -29,14 +29,14 @@ EGVAR(advanced_ballistics,Protractor) = false; GVAR(WindInfo) = true; -TRACE_1("Starting Wind Info PFEH", GVAR(WindInfo)); +TRACE_1("Starting Wind Info PFEH",GVAR(WindInfo)); [{ disableSerialization; params ["", "_pfID"]; if ((!GVAR(WindInfo)) || {!([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith))}) exitWith { - TRACE_1("Ending Wind Info PFEH", GVAR(WindInfo)); + TRACE_1("Ending Wind Info PFEH",GVAR(WindInfo)); GVAR(WindInfo) = false; (["RscWindIntuitive"] call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; [_pfID] call CBA_fnc_removePerFrameHandler; diff --git a/addons/weather/functions/fnc_getApproximateAirTemp.sqf b/addons/weather/functions/fnc_getApproximateAirTemp.sqf index 33227907a3..91b8af3fcc 100644 --- a/addons/weather/functions/fnc_getApproximateAirTemp.sqf +++ b/addons/weather/functions/fnc_getApproximateAirTemp.sqf @@ -18,7 +18,7 @@ params ["_unit"]; TRACE_1("params",_unit); -if (isNil (format ["%1", _unit getVariable "ACE_airTemperatureBias"])) then { +if (isNil {_unit getVariable "ACE_airTemperatureBias"}) then { _unit setVariable ["ACE_airTemperatureBias", [-(random(3) + 1), random(3) + 1]]; }; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index e4b547c032..c1b93818f0 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {_projectile isKindOf "BulletBase" && {_unit isKindOf "Man"}}) exitWith {false}; diff --git a/addons/xm157/functions/fnc_weaponInfo_draw.sqf b/addons/xm157/functions/fnc_weaponInfo_draw.sqf index ef9fd1d528..c03b575f4e 100644 --- a/addons/xm157/functions/fnc_weaponInfo_draw.sqf +++ b/addons/xm157/functions/fnc_weaponInfo_draw.sqf @@ -86,7 +86,7 @@ if (_retTex != ctrlText _ctrlScopeReticle) then { _ctrlScopeReticle ctrlSetText private _rangeInfo = _range call { if (_range == 0) exitWith { "" }; if (_range < 0) exitWith { // range error - blink if recent - if ((_timeSinceLastInput < 3) && {(floor (4*_timeSinceLastInput)) % 2 == 1}) then { "----" } else { "" }; + ["", "----"] select ((_timeSinceLastInput < 3) && {(floor (4*_timeSinceLastInput)) % 2 == 1}); }; format ["%1 m", _range toFixed 0] }; @@ -98,7 +98,7 @@ _ctrl ctrlSetText _rangeInfo; private _bearingInfo = call { private _bearingSetting = GVAR(data) getOrDefault ["bearing_show", 0]; if ((_bearingSetting == 2) && {_timeSinceLastInput > 2}) exitWith { "" }; - if ((_bearingSetting == 1)) exitWith { format ["%1", floor (17.777777 * _weaponDir)]; }; // (6400 Mils, not MRAD) + if ((_bearingSetting == 1)) exitWith { str floor (17.777777 * _weaponDir); }; // (6400 Mils, not MRAD) format ["%1°", floor _weaponDir]; }; private _ctrl = _display displayCtrl IDC_SCREEN_TEXT_UPPER_LEFT; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index c597955a23..ec04a12d24 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -257,7 +257,7 @@ if (_activated) then { //--- Player if (hasinterface) then { waituntil {local player}; - _serverCommand = if (_ownerVar == "#adminLogged") then {"#shutdown"} else {"#kick"}; + _serverCommand = ["#kick", "#shutdown"] select (_ownerVar == "#adminLogged"); //--- Black effect until the interface is open _forced = _logic getvariable ["forced",0] > 0; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index b2288be91c..2aa438be53 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -30,7 +30,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { //--- Get unit under cursor _unit = objnull; _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; - if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; + if ((_mouseOver select 0) == "OBJECT") then {_unit = _mouseOver select 1;}; _unit = effectivecommander _unit; //--- Temp owner diff --git a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf index 615a11d271..dded460710 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf @@ -48,7 +48,7 @@ waitUntil { }; TRACE_2("Finished primary movement",_vehicle distance2D _wpPos,_closeEnoughTicks); -if ((!alive _vehicle) || {!alive _commander}) exitWith {TRACE_2("died",alive _vehicle, alive _commander); true}; +if ((!alive _vehicle) || {!alive _commander}) exitWith {TRACE_2("died",alive _vehicle,alive _commander); true}; if (((getPos _vehicle) select 2) < 25) exitWith {TRACE_1("too low",getPos _vehicle); true}; // Fly level and straight diff --git a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf index 6c511bae07..6d2a94139b 100644 --- a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf +++ b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf @@ -30,7 +30,7 @@ switch (true) do { }; default { - TRACE_1("Calling removeVirtualXXXCargo functions", _object); + TRACE_1("Calling removeVirtualXXXCargo functions",_object); [_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo; [_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo; [_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo; diff --git a/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf index 9c34bc8f65..5c9a220615 100644 --- a/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf +++ b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf @@ -53,7 +53,7 @@ if !(isNull _unit) then { if (isNull _unit) then { (_display displayCtrl 56220) lbDelete 0; } else { - (_display displayCtrl 56218) lbSetCurSel ([0, 1] select (_unit isFlashlightOn currentWeapon _unit)); + (_display displayCtrl 56218) lbSetCurSel (parseNumber (_unit isFlashlightOn currentWeapon _unit)); }; private _fnc_onUnload = { diff --git a/addons/zeus/functions/fnc_ui_toggleNvg.sqf b/addons/zeus/functions/fnc_ui_toggleNvg.sqf index 1e60a777ea..5d5747c7ca 100644 --- a/addons/zeus/functions/fnc_ui_toggleNvg.sqf +++ b/addons/zeus/functions/fnc_ui_toggleNvg.sqf @@ -53,7 +53,7 @@ if !(isNull _unit) then { if (isNull _unit) then { (_display displayCtrl 92856) lbDelete 0; } else { - (_display displayCtrl 92855) lbSetCurSel ([0, 1] select (hmd _unit isNotEqualTo "")); + (_display displayCtrl 92855) lbSetCurSel (parseNumber (hmd _unit isNotEqualTo "")); }; private _fnc_onUnload = { diff --git a/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf b/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf index be5a9adb3e..09aba83b06 100644 --- a/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf +++ b/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf @@ -54,7 +54,7 @@ switch _mode do { _control = _display displayctrl _idc; //--- Admin specific attribute - _show = if (getnumber (_cfgControl >> "adminOnly") > 0) then {_enableAdmin} else {true}; + _show = [true, _enableAdmin] select (getnumber (_cfgControl >> "adminOnly") > 0); if ((_allAttributes || {_x == configname _cfgControl} count _attributes > 0) && _show) then { _controlPos = ctrlposition _control; @@ -75,10 +75,10 @@ switch _mode do { _target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull]; _name = switch (typename _target) do { - case (typename objnull): {gettext (configfile >> "cfgvehicles" >> typeof _target >> "displayname")}; - case (typename grpnull): {groupid _target}; - case (typename []): {format ["%1: %3 #%2",groupid (_target select 0),_target select 1,localize "str_a3_cfgmarkers_waypoint_0"]}; - case (typename ""): {markertext _target}; + case ("OBJECT"): {gettext (configfile >> "cfgvehicles" >> typeof _target >> "displayname")}; + case ("GROUP"): {groupid _target}; + case ("ARRAY"): {format ["%1: %3 #%2",groupid (_target select 0),_target select 1,localize "str_a3_cfgmarkers_waypoint_0"]}; + case ("STRING"): {markertext _target}; }; _ctrlTitle ctrlsettext format [ctrltext _ctrlTitle,toupper _name]; @@ -115,19 +115,19 @@ switch _mode do { _display = _this select 0; _target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull]; switch (typename _target) do { - case (typename objnull): { + case ("OBJECT"): { _isAlive = alive _target; waituntil {isnull _display || (_isAlive && !alive _target)}; }; - case (typename grpnull): { + case ("GROUP"): { waituntil {isnull _display || isnull _target}; }; - case (typename []): { + case ("ARRAY"): { _grp = _target select 0; _wpCount = count waypoints _grp; waituntil {isnull _display || (count waypoints _grp != _wpCount)}; }; - case (typename ""): { + case ("STRING"): { waituntil {isnull _display || markertype _target == ""}; }; };