From 571795c69d0864d59b2212a2bb8573dca652420a Mon Sep 17 00:00:00 2001 From: diwako Date: Wed, 22 Oct 2025 22:20:08 +0200 Subject: [PATCH] Hemtt checker update --- .github/workflows/main.yml | 19 +++ .hemtt/project.toml | 6 + AUTHORS.txt | 2 +- addons/ai/CfgAmmo.hpp | 8 +- addons/ai/config.cpp | 2 +- addons/ai/functions/fnc_forceMoveWp.sqf | 6 +- addons/ai/functions/fnc_spawnGroups.sqf | 6 +- addons/ares/functions/fnc_ai.sqf | 2 +- addons/ares/functions/fnc_ejectCargo.sqf | 3 +- addons/ares/functions/fnc_proximityIed.sqf | 2 +- addons/ares/zenModules.inc.sqf | 6 +- addons/axe/functions/fnc_findTrunk.sqf | 9 +- addons/axe/functions/fnc_interactEH.sqf | 4 +- addons/common/CfgEventHandlers.hpp | 2 +- addons/common/config.cpp | 2 +- addons/common/functions/fnc_copyAllGear.sqf | 2 +- .../common/functions/fnc_disableWeapons.sqf | 5 +- .../common/functions/fnc_initViewDistance.sqf | 2 +- addons/common/functions/fnc_respawnMenu.sqf | 6 +- .../common/functions/fnc_strategicMapOpen.sqf | 146 +++++++++--------- addons/difficulty/CfgEventHandlers.hpp | 2 +- addons/difficulty/CfgSurfaces.hpp | 2 +- addons/difficulty/config.cpp | 2 +- addons/jrm/CfgEventHandlers.hpp | 4 +- addons/jrm/functions/fnc_forceRespawn.sqf | 2 +- addons/logging/functions/fnc_fired.sqf | 4 +- addons/logging/functions/fnc_handleDamage.sqf | 2 +- addons/logging/functions/fnc_killed.sqf | 10 +- addons/main/script_mod.hpp | 6 +- .../message_ui/functions/fnc_initListbox.sqf | 2 +- addons/saveMarkers/functions/fnc_onDraw.sqf | 1 + .../functions/fnc_onMouseButtonDownMap.sqf | 4 +- .../saveMarkers/functions/fnc_saveMarkers.sqf | 2 +- .../functions/fnc_updateSavesList.sqf | 4 +- addons/saveMarkers/ui/dialog.hpp | 12 +- include/x/cba/addons/xeh/script_xeh.hpp | 2 +- include/z/ace/addons/main/script_macros.hpp | 2 +- optionals/compositions/CfgGroups.hpp | 2 +- 38 files changed, 168 insertions(+), 137 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..559f186 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,19 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT build + run: | + hemtt check --pedantic + hemtt release diff --git a/.hemtt/project.toml b/.hemtt/project.toml index f5a777e..0c7582c 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -40,3 +40,9 @@ workshop = [ parameters = [ "-world=empty" ] + +[lints.sqf.var_all_caps] +enabled = true +options.ignore = [ + "ACRE_IS_SPECTATOR" +] diff --git a/AUTHORS.txt b/AUTHORS.txt index 426e7e4..c8f1c45 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -5,4 +5,4 @@ Cuel # CONTRIBUTORS -diwako \ No newline at end of file +diwako diff --git a/addons/ai/CfgAmmo.hpp b/addons/ai/CfgAmmo.hpp index 064a65d..d900fc6 100644 --- a/addons/ai/CfgAmmo.hpp +++ b/addons/ai/CfgAmmo.hpp @@ -1,7 +1,7 @@ class CfgAmmo { class RocketBase; class R_PG7_F : RocketBase { - aiAmmoUsageFlags = "64 + 128 + 256 + 512"; + aiAmmoUsageFlags = 64 + 128 + 256 + 512; airLock = 1; allowAgainstInfantry = 1; cost = 0.1; @@ -9,17 +9,17 @@ class CfgAmmo { whistleDist = 30; }; class M_SPG9_HEAT : RocketBase { - aiAmmoUsageFlags = "64 + 128 + 512"; + aiAmmoUsageFlags = 64 + 128 + 512; allowAgainstInfantry = 1; }; class R_PG32V_F : RocketBase { - aiAmmoUsageFlags = "64 + 128 + 256 + 512"; + aiAmmoUsageFlags = 64 + 128 + 256 + 512; airLock = 1; allowAgainstInfantry = 1; cost = 40; }; class R_MRAAWS_HEAT_F : RocketBase { - aiAmmoUsageFlags = "64 + 128 + 512"; + aiAmmoUsageFlags = 64 + 128 + 512; allowAgainstInfantry = 1; cost = 40; }; diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index 9979fd6..255ae95 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -12,4 +12,4 @@ class CfgPatches { }; #include "CfgAmmo.hpp" -#include "CfgEventHandlers.hpp" \ No newline at end of file +#include "CfgEventHandlers.hpp" diff --git a/addons/ai/functions/fnc_forceMoveWp.sqf b/addons/ai/functions/fnc_forceMoveWp.sqf index 2063afd..26b9364 100644 --- a/addons/ai/functions/fnc_forceMoveWp.sqf +++ b/addons/ai/functions/fnc_forceMoveWp.sqf @@ -29,7 +29,7 @@ if (_prevId != -1) then { [_prevId] call CBA_fnc_removePerFrameHandler; }; -_targetPos = waypointPosition [_grp, _curWp]; +private _targetPos = waypointPosition [_grp, _curWp]; { private _unit = _x; {_unit disableAI _x} forEach AI_MODES; @@ -47,11 +47,11 @@ private _pfhCode = { private _wpPos = waypointPosition [_grp, _curWp]; private _units = units _grp; private _aliveUnits = _units select {alive _x && {!(_x getVariable ["ACE_isUnconscious", false])}}; - private _noUnits = count _aliveUnits == 0; + private _noUnits = _aliveUnits isEqualTo []; private _wpChanged = (_wpPos isNotEqualTo _origWpPos); private _someoneClose = {_x distance _wpPos < 15} count units _grp > 0; - if (_wpChanged || {_noUnits} || {_someoneClose}) exitWith { + if (_wpChanged || _noUnits || _someoneClose) exitWith { TRACE_3("Exiting",_noUnits,_wpChanged,_someoneClose); { private _unit = _x; diff --git a/addons/ai/functions/fnc_spawnGroups.sqf b/addons/ai/functions/fnc_spawnGroups.sqf index 946d1bc..41e2e97 100644 --- a/addons/ai/functions/fnc_spawnGroups.sqf +++ b/addons/ai/functions/fnc_spawnGroups.sqf @@ -63,7 +63,7 @@ private _newGroups = []; { _type = _x; - _amount = _backpackCargo#1#_forEachIndex; + private _amount = _backpackCargo#1#_forEachIndex; _veh addBackpackCargoGlobal [_type, _amount]; } forEach _backpackCargo#0; @@ -71,7 +71,7 @@ private _newGroups = []; private _array = _x; { _type = _x; - _amount = _array#1#_forEachIndex; + private _amount = _array#1#_forEachIndex; _veh addItemCargoGlobal [_type, _amount]; } forEach (_array#0); } forEach [_itemCargo, _magazineCargo, _weaponCargo]; @@ -124,7 +124,7 @@ private _newGroups = []; _wp setWaypointTimeout _timeout; _wp setWaypointVisible _visible; } forEach _waypoints; - private _leader = leader _group; + // private _leader = leader _group; _group setCombatMode _combatMode; _group setCombatBehaviour _behaviour; diff --git a/addons/ares/functions/fnc_ai.sqf b/addons/ares/functions/fnc_ai.sqf index 16b1319..1b7d649 100644 --- a/addons/ares/functions/fnc_ai.sqf +++ b/addons/ares/functions/fnc_ai.sqf @@ -14,7 +14,7 @@ _grp = [_grp] call CBA_fnc_getGroup; private _units = units _grp; private _zen = !isNil "zen_custom_modules_fnc_register"; private _msgFnc = [ares_fnc_ShowZeusMessage, zen_common_fnc_showMessage] select _zen; -if (_grp isEqualTo grpNull || {count _units == 0} || {{isPlayer _x} count _units > 0}) exitWith { +if (_grp isEqualTo grpNull || {_units isEqualTo []} || {{isPlayer _x} count _units > 0}) exitWith { ["Invalid group"] call _msgFnc; }; diff --git a/addons/ares/functions/fnc_ejectCargo.sqf b/addons/ares/functions/fnc_ejectCargo.sqf index fe79c95..0fee6b0 100644 --- a/addons/ares/functions/fnc_ejectCargo.sqf +++ b/addons/ares/functions/fnc_ejectCargo.sqf @@ -11,7 +11,8 @@ params ["_vehicle"]; if (!alive _vehicle || {_vehicle isKindOf "CAManBase"}) exitWith {}; -private _msgFnc = [_msgFnc, zen_common_fnc_showMessage] select _zen; +private _zen = !isNil "zen_custom_modules_fnc_register"; +private _msgFnc = [ares_fnc_ShowZeusMessage, zen_common_fnc_showMessage] select _zen; if (abs (speed _vehicle) > 2) exitWith { ["ERROR: Vehicle is moving"] call _msgFnc; diff --git a/addons/ares/functions/fnc_proximityIed.sqf b/addons/ares/functions/fnc_proximityIed.sqf index 31517c0..26464fc 100644 --- a/addons/ares/functions/fnc_proximityIed.sqf +++ b/addons/ares/functions/fnc_proximityIed.sqf @@ -41,7 +41,7 @@ private _onAct = { ("M_Titan_AT" createVehicle [_pos select 0, _pos select 1, (_pos select 2) + 0.1]) setVelocity [0, 0, -50]; [2.5, 2, 25] remoteExecCall ["addCamShake", allPlayers select {alive _x && (_x distance _pos) < 50}]; - _crater = createVehicle ["CraterLong_small", _pos, [], 0, "NONE"]; + private _crater = createVehicle ["CraterLong_small", _pos, [], 0, "NONE"]; [{ deleteVehicle _this; }, _crater, 300] call CBA_fnc_waitAndExecute; diff --git a/addons/ares/zenModules.inc.sqf b/addons/ares/zenModules.inc.sqf index 860ea7b..84dcbd9 100644 --- a/addons/ares/zenModules.inc.sqf +++ b/addons/ares/zenModules.inc.sqf @@ -2,10 +2,10 @@ [UTIL, "Camera at position", { params ["_pos", "_obj"]; - if (!isNull _obj) then { - _pos = _obj call CBA_fnc_getPos; - } else { + if (isNull _obj) then { _pos = ASLToATL _pos; + } else { + _pos = _obj call CBA_fnc_getPos; }; [_pos, false] call EFUNC(common,cameraAtPosition); diff --git a/addons/axe/functions/fnc_findTrunk.sqf b/addons/axe/functions/fnc_findTrunk.sqf index 2cda764..aa9b32c 100644 --- a/addons/axe/functions/fnc_findTrunk.sqf +++ b/addons/axe/functions/fnc_findTrunk.sqf @@ -17,9 +17,9 @@ if (isNil QGVAR(trunkOffsetsCache)) then {GVAR(trunkOffsetsCache) = call CBA_fnc private _modelName = ((str _tree) splitString " .") select 1; private _offset = GVAR(trunkOffsetsCache) getVariable [_modelName,[]]; if (_offset isNotEqualTo []) exitWith { - _dirCCW = -(getDir _tree); + private _dirCCW = -(getDir _tree); _offset params ["_x","_y"]; - _trunkPos = (getPosASL _tree) vectorAdd [_x * cos _dirCCW - _y * sin _dirCCW, _x * sin _dirCCW + _y * cos _dirCCW, 0]; + private _trunkPos = (getPosASL _tree) vectorAdd [_x * cos _dirCCW - _y * sin _dirCCW, _x * sin _dirCCW + _y * cos _dirCCW, 0]; _trunkPos set [2,_searchPos select 2]; _trunkPos }; @@ -31,6 +31,7 @@ private _searchDirections = [[0,90,180,270],[45,135,225,315]]; private _searchInterval = 45; private _trunkFound = false; private _trunkPos = _searchPos; +private _iteration = 0; { _iteration = _forEachIndex; { @@ -47,8 +48,8 @@ private _trunkPos = _searchPos; if (_iteration > 3) exitWith {}; - _searchInterval = _searchInterval / 2; - _nextDirections = _searchDirections select (_searchDirections pushBack []); + private _searchInterval = _searchInterval / 2; + private _nextDirections = _searchDirections select (_searchDirections pushBack []); { _nextDirections pushBack (_x + _searchInterval); _nextDirections pushBack (_x - _searchInterval); diff --git a/addons/axe/functions/fnc_interactEH.sqf b/addons/axe/functions/fnc_interactEH.sqf index 3c22c04..6895fc5 100644 --- a/addons/axe/functions/fnc_interactEH.sqf +++ b/addons/axe/functions/fnc_interactEH.sqf @@ -30,12 +30,12 @@ if !([ace_player, QGVAR(axe)] call ace_common_fnc_hasItem) exitWith {}; if (((getPosASL ace_player) distance _setPosition) <= 5) exitWith {}; private _fncStatement = { - params ["", "_player", "_attachedTree"]; + params ["", "", "_attachedTree"]; [_player, _attachedTree] call FUNC(cutDownTree); }; private _fncCondition = { - params ["_helper", "_player", "_attachedTree"]; + params ["_helper", "", "_attachedTree"]; if (!([_player, _attachedTree, ["isNotSwimming"]] call ace_common_fnc_canInteractWith)) exitWith {false}; diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 7b7504f..1d9435e 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -20,7 +20,7 @@ class Extended_PostInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayCurator { - ADDON = QUOTE(_this call FUNC(onZeusInterface)); + ADDON = QUOTE(call FUNC(onZeusInterface)); }; }; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 276b148..ebec256 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -31,7 +31,7 @@ class RscDisplayCurator { h = "12 * pixelH"; sizeEx = "12 * pixelH"; text = "ACRE Spectator"; - action = QUOTE(_this call FUNC(toggleZeusAcre)); + action = QUOTE(call FUNC(toggleZeusAcre)); }; class GVAR(unitCount): RscText { idc = 777551; diff --git a/addons/common/functions/fnc_copyAllGear.sqf b/addons/common/functions/fnc_copyAllGear.sqf index 8e62e18..fc4e44e 100644 --- a/addons/common/functions/fnc_copyAllGear.sqf +++ b/addons/common/functions/fnc_copyAllGear.sqf @@ -114,7 +114,7 @@ if (!isNull unitBackpack _center) then { // Assigned items private _assignedItems = assignedItems _center - [binocular _center, "ItemRadioAcreFlagged"]; -if (count _assignedItems > 0) then { +if (_assignedItems isNotEqualTo []) then { _export pushBack format ['{%1 linkItem _x} forEach %2;%3', _var, _assignedItems, _br]; }; diff --git a/addons/common/functions/fnc_disableWeapons.sqf b/addons/common/functions/fnc_disableWeapons.sqf index 69ea09c..a91b321 100644 --- a/addons/common/functions/fnc_disableWeapons.sqf +++ b/addons/common/functions/fnc_disableWeapons.sqf @@ -23,6 +23,7 @@ #include "script_component.hpp" #define CAN_FIRE ((ace_player getVariable [QGVAR(disableWeaponsReasons), []]) isEqualTo []) +#define CANT_FIRE ((ace_player getVariable [QGVAR(disableWeaponsReasons), []]) isNotEqualTo []) params [["_disableWeapons", false], ["_reason", ""]]; if (!hasInterface) exitWith {}; @@ -43,11 +44,11 @@ if (isNil QGVAR(weaponsEvtId)) then { deleteVehicle _obj; }] call CBA_fnc_addEventHandler; - GVAR(weaponsEvtId) = [ace_player, "DefaultAction", {!CAN_FIRE}, {}] call ace_common_fnc_addActionEventHandler; + GVAR(weaponsEvtId) = [ace_player, "DefaultAction", {CANT_FIRE}, {}] call ace_common_fnc_addActionEventHandler; ["unit", { params ["_new", "_old"]; [_old, "DefaultAction", GVAR(weaponsEvtId)] call ace_common_fnc_removeActionEventHandler; - GVAR(weaponsEvtId) = [_new, "DefaultAction", {!CAN_FIRE}, {}] call ace_common_fnc_addActionEventHandler; + GVAR(weaponsEvtId) = [_new, "DefaultAction", {CANT_FIRE}, {}] call ace_common_fnc_addActionEventHandler; }] call CBA_fnc_addPlayerEventHandler; }; diff --git a/addons/common/functions/fnc_initViewDistance.sqf b/addons/common/functions/fnc_initViewDistance.sqf index 5313e02..1cafe5e 100644 --- a/addons/common/functions/fnc_initViewDistance.sqf +++ b/addons/common/functions/fnc_initViewDistance.sqf @@ -9,7 +9,7 @@ #include "script_component.hpp" private _insertChildren = { - params ["_target", "_player", "_params"]; + params ["", "", "_params"]; _params params ["_setOveral", "_setObject"]; // Add children to this action diff --git a/addons/common/functions/fnc_respawnMenu.sqf b/addons/common/functions/fnc_respawnMenu.sqf index 2848147..e02beea 100644 --- a/addons/common/functions/fnc_respawnMenu.sqf +++ b/addons/common/functions/fnc_respawnMenu.sqf @@ -40,11 +40,11 @@ if (_missions isEqualTo []) then { if (_name isEqualTo "") then { private _locTypes = ["NameCityCapital","NameCity","NameVillage"]; private _nearbyLocation = nearestLocations [_pos, _locTypes, 1000] param [0, locationNull]; - if (!isNull _nearbyLocation) then { - _name = format ["Near %1", text _nearbyLocation]; - } else { + if (isNull _nearbyLocation) then { _idx = _idx + 1; _name = format ["Respawn #%1", _idx]; + } else { + _name = format ["Near %1", text _nearbyLocation]; }; }; diff --git a/addons/common/functions/fnc_strategicMapOpen.sqf b/addons/common/functions/fnc_strategicMapOpen.sqf index c7a6738..84035da 100644 --- a/addons/common/functions/fnc_strategicMapOpen.sqf +++ b/addons/common/functions/fnc_strategicMapOpen.sqf @@ -64,7 +64,7 @@ _ORBAT = _this param [3,[],[[]]]; _markers = _this param [4,[],[[]]]; _images = _this param [5,[],[[]]]; _overcast = (_this param [6,overcast,[0]]) max 0 min 1; -_isNight = _this param [7,false,[false]]; +private _isNight = _this param [7,false,[false]]; _defaultScale = _this param [8,1,[0]]; _simulationEnabled = _this param [9,false,[false]]; _actionText = _this param [10,localize "str_a3_rscdisplaystrategicmap_missions",[""]]; @@ -75,15 +75,15 @@ BIS_fnc_strategicMapOpen_showIconText = _showIconText; BIS_fnc_strategicMapOpen_missionIcon = _missionIcon; //--- Calculate terrain size and outside color -_mapSize = worldSize; +private _mapSize = worldSize; BIS_fnc_strategicMapOpen_mapSize = _mapSize; BIS_fnc_strategicMapOpen_isNight = _isNight; _scale = 3500 / _mapSize / safeZoneH; _scale = _scale * (_defaultScale max 0 min 1); -_maxSatelliteAlpha = [1, 0.75] select _isNight; +private _maxSatelliteAlpha = [1, 0.75] select _isNight; -_colorOutside = configFile >> "CfgWorlds" >> worldName >> "OutsideTerrain" >> "colorOutside"; +private _colorOutside = configFile >> "CfgWorlds" >> worldName >> "OutsideTerrain" >> "colorOutside"; _colorOutside = if (isArray _colorOutside) then { _colorOutside call bis_fnc_colorCOnfigToRGBA; } else { @@ -117,7 +117,7 @@ BIS_fnc_strategicMapOpen_player = player; //--- Process ORBAT BIS_fnc_strategicMapOpen_ORBAT = []; -_onClick = []; +private _onClick = []; { private ["_pos","_class","_parent","_tags","_tiers","_classParams","_text","_texture","_size","_color","_sizeLocal","_sizeParams","_sizeTexture"]; _pos = _x param [0,player]; @@ -134,7 +134,7 @@ _onClick = []; _size = _classParams select ("size" call bis_fnc_ORBATGetGroupParams); _color = _classParams select ("color" call bis_fnc_ORBATGetGroupParams); - _iconSize = sqrt (_size + 1) * 32; + private _iconSize = sqrt (_size + 1) * 32; //--- Group size //_sizeLocal = _size max 0 min (count (BIS_fnc_ORBATGetGroupParams_sizes) - 1); @@ -172,11 +172,11 @@ if (count _missions > 0) then { _playerIcon = getText (configFile >> "CfgInGameUI" >> "IslandMap" >> "iconPlayer"); _playerColor = (getArray (configFile >> "cfgingameui" >> "islandmap" >> "colorMe")) call BIS_fnc_colorRGBAtoHTML; - _ctrlBackground = _display displayCtrl 1000; + private _ctrlBackground = _display displayCtrl 1000; _ctrlBackground ctrlShow false; - _ctrlMissions = _display displayCtrl 1500; - _lbAdd = _ctrlMissions lbAdd _actionText; + private _ctrlMissions = _display displayCtrl 1500; + private _lbAdd = _ctrlMissions lbAdd _actionText; _ctrlMissions lbSetValue [_lbAdd,-1]; _ctrlMissions lbSetColor [_lbAdd,[1,1,1,0.5]]; { @@ -246,7 +246,7 @@ BIS_fnc_strategicMapOpen_images = []; _pos = _pos call bis_fnc_position; _color = _color call bis_fnc_colorConfigToRGBA; - _coef = (0.182 * safeZoneH); //--- Magic constant to make kilometer a kilometer + private _coef = (0.182 * safeZoneH); //--- Magic constant to make kilometer a kilometer _w = _w * _coef; _h = _h * _coef; @@ -289,19 +289,19 @@ BIS_fnc_strategicMapOpen_indexTextureSize = ("textureSize" call bis_fnc_ORBATGet BIS_fnc_strategicMapOpen_draw = { scriptName "bis_fnc_strategicMapOpen - Draw"; - _map = _this select 0; - _mapSize = BIS_fnc_strategicMapOpen_mapSize / 2; - _display = ctrlParent _map; - _time = diag_tickTime; + private _map = _this select 0; + private _mapSize = BIS_fnc_strategicMapOpen_mapSize / 2; + private _display = ctrlParent _map; + private _time = diag_tickTime; //_tooltip = (ctrlParent _map) displayCtrl 2350; //_tooltip ctrlSetFade 1; //_tooltip ctrlCommit 0; - _mousePos = _map ctrlMapScreenToWorld BIS_fnc_strategicMapOpen_mousePos; + private _mousePos = _map ctrlMapScreenToWorld BIS_fnc_strategicMapOpen_mousePos; //_mouseLimit = BIS_fnc_strategicMapOpen_mapSize / 3400; - _mouseLimit = 2.5 / safeZoneH; - _selected = []; + private _mouseLimit = 2.5 / safeZoneH; + private _selected = []; //--- Cross grid _map drawRectangle [ @@ -320,12 +320,12 @@ BIS_fnc_strategicMapOpen_draw = { //--- ORBAT groups { - _class = _x select 0; - _iconParams = +(_x select 2); - _classParams = +(_x select 3); + // private _class = _x select 0; + private _iconParams = +(_x select 2); + private _classParams = +(_x select 3); - _pos = _iconParams select 2; - _iconSize = _iconParams select 3; + // private _pos = _iconParams select 2; + private _iconSize = _iconParams select 3; if (((_iconParams select 2) distance _mousePos) < (_mouseLimit * _iconSize)) then { _iconParams set [3,(_iconParams select 3) * 1.2]; @@ -333,17 +333,17 @@ BIS_fnc_strategicMapOpen_draw = { _selected = _x; }; - _textureSize = _classParams select BIS_fnc_strategicMapOpen_indexTextureSize; - _iconSizeParams = +_iconParams; + private _textureSize = _classParams select BIS_fnc_strategicMapOpen_indexTextureSize; + private _iconSizeParams = +_iconParams; _iconParams set [3,(_iconParams select 3) * _textureSize]; _iconParams set [4,(_iconParams select 4) * _textureSize]; _map drawIcon _iconParams; //--- Draw size texture - _size = _classParams select 5; + private _size = _classParams select 5; if (_size >= 0) then { - _sizeTexture = _classParams select BIS_fnc_strategicMapOpen_indexSizeTexture; + private _sizeTexture = _classParams select BIS_fnc_strategicMapOpen_indexSizeTexture; _iconSizeParams set [0,_sizeTexture]; _map drawIcon _iconSizeParams; }; @@ -351,14 +351,14 @@ BIS_fnc_strategicMapOpen_draw = { } forEach BIS_fnc_strategicMapOpen_ORBAT; //--- Clouds - _cloudSpeed = sin _time * (1138 + 2000 * BIS_fnc_strategicMapOpen_overcast); + private _cloudSpeed = sin _time * (1138 + 2000 * BIS_fnc_strategicMapOpen_overcast); { - _texture = _x select 0; - _posX = _x select 1; - _posY = _x select 2; - _dir = _x select 3; - _size = _x select 4; - _color = _x select 5; + private _texture = _x select 0; + private _posX = _x select 1; + private _posY = _x select 2; + private _dir = _x select 3; + private _size = _x select 4; + private _color = _x select 5; _map drawIcon [ _texture, @@ -376,14 +376,14 @@ BIS_fnc_strategicMapOpen_draw = { } forEach BIS_fnc_strategicMapOpen_clouds; //--- Missions - _textureAnimPhase = abs(6 - floor (_time * 16) % 12); + private _textureAnimPhase = abs(6 - floor (_time * 16) % 12); { - _pos = _x select 0; - _title = _x select 2; - _size = (_x select 3) * 32; - _dir = 0; - _alpha = 0.75; - _texture = format [BIS_fnc_strategicMapOpen_missionIcon,_textureAnimPhase,_forEachindex + 1]; + private _pos = _x select 0; + private _title = _x select 2; + private _size = (_x select 3) * 32; + private _dir = 0; + private _alpha = 0.75; + private _texture = format [BIS_fnc_strategicMapOpen_missionIcon,_textureAnimPhase,_forEachindex + 1]; //--- Icon is under cursor if ((_pos distance _mousePos) < (_mouseLimit * _size)) then { @@ -393,14 +393,14 @@ BIS_fnc_strategicMapOpen_draw = { }; //--- Outside of the screen area - _mappos = _map ctrlMapWorldToScreen _pos; - _mapposX = _mappos select 0; - _mapposY = _mappos select 1; + private _mappos = _map ctrlMapWorldToScreen _pos; + private _mapposX = _mappos select 0; + private _mapposY = _mappos select 1; - _borderLeft = safeZoneX; - _borderRight = safeZoneX + safeZoneW; - _borderTop = safeZoneY; - _borderBottom = safeZoneY + safeZoneH; + private _borderLeft = safeZoneX; + private _borderRight = safeZoneX + safeZoneW; + private _borderTop = safeZoneY; + private _borderBottom = safeZoneY + safeZoneH; if ( _mapposX < _borderLeft || _mapposX > _borderRight @@ -412,11 +412,11 @@ BIS_fnc_strategicMapOpen_draw = { _mapposY = _mapposY max safeZoneY min (safeZoneY + safeZoneH); _title = ""; - _offset = (_size / 1200); - _offsetDefX = _offset; - _offsetDefY = _offset * 4/3; - _offsetX = 0; - _offsetY = 0; + private _offset = (_size / 1200); + private _offsetDefX = _offset; + private _offsetDefY = _offset * 4/3; + private _offsetX = 0; + private _offsetY = 0; _dir = -([[0.5,0.5],_mappos] call bis_fnc_dirto) - 90; switch (true) do { @@ -476,8 +476,8 @@ BIS_fnc_strategicMapOpen_draw = { //--- ORBAT case 4: { - _class = _selected select 0; - _classParams = _selected select 3; + // private _class = _selected select 0; + private _classParams = _selected select 3; [_classParams,_display,BIS_fnc_strategicMapOpen_mousePos] call bis_fnc_ORBATTooltip; }; @@ -507,13 +507,13 @@ BIS_fnc_strategicMapOpen_mouse = { #define DIK_NUMPAD5 0x4C BIS_fnc_strategicMapOpen_keyDown = { - _display = _this select 0; - _key = _this select 1; + private _display = _this select 0; + private _key = _this select 1; //--- H switch _key do { case DIK_H: { - _fade = ceil ctrlFade (_display displayCtrl 2); + private _fade = ceil ctrlFade (_display displayCtrl 2); _fade = (_fade + 1) % 2; { (_display displayCtrl _x) ctrlSetFade _fade; @@ -547,20 +547,20 @@ if (_isNight) then { //--- Measure [_display] spawn { disableSerialization; - _display = _this select 0; - _showMiles = false; + private _display = _this select 0; + private _showMiles = false; - _map = _display displayCtrl 51; + private _map = _display displayCtrl 51; waitUntil {ctrlMapAnimDone _map}; - _xStart = (_map ctrlMapWorldToScreen [0,0,0]) select 0; - _xEnd = (_map ctrlMapWorldToScreen [1000,0,0]) select 0; - _w1km = abs (_xstart - _xEnd); - _w1m = _w1km * 1.60934; + private _xStart = (_map ctrlMapWorldToScreen [0,0,0]) select 0; + private _xEnd = (_map ctrlMapWorldToScreen [1000,0,0]) select 0; + private _w1km = abs (_xstart - _xEnd); + private _w1m = _w1km * 1.60934; if !(_showMiles) then {_w1m = 0.01}; - _h = 0.01; + private _h = 0.01; - _measure = _display displayCtrl 2301; + private _measure = _display displayCtrl 2301; _measure ctrlSetPosition [ safeZoneX + 0.02125, safeZoneY + safeZoneH - 3.5 * 0.04, @@ -571,10 +571,10 @@ if (_isNight) then { _measure ctrlCommit 0; _measure ctrlEnable false; - _colors = ["#(argb,8,8,3)color(0,0,0,1)","\A3\Ui_f\data\GUI\Rsc\RscDisplayStrategicMap\measure_ca.paa"]; - _kmSegment = _w1km / 5; + private _colors = ["#(argb,8,8,3)color(0,0,0,1)","\A3\Ui_f\data\GUI\Rsc\RscDisplayStrategicMap\measure_ca.paa"]; + private _kmSegment = _w1km / 5; for "_i" from 0 to 4 do { - _km = _display displayCtrl (1200 + _i); + private _km = _display displayCtrl (1200 + _i); _km ctrlSetText (_colors select (_i % 2)); _km ctrlSetPosition [ _w1m + _kmSegment * _i, @@ -585,7 +585,7 @@ if (_isNight) then { _km ctrlCommit 0; }; - _text_0 = _display displayCtrl 1002; + private _text_0 = _display displayCtrl 1002; _text_0 ctrlSetPosition [ _w1m - _w1km, _h * 3, @@ -593,7 +593,7 @@ if (_isNight) then { _h * 2 ]; _text_0 ctrlCommit 0; - _text_km = _display displayCtrl 1004; + private _text_km = _display displayCtrl 1004; _text_km ctrlSetPosition [ _w1m - _w1km + (safeZoneH / 30), _h * 3, @@ -603,7 +603,7 @@ if (_isNight) then { _text_km ctrlCommit 0; if (_showMiles) then { - _m0 = _display displayCtrl 1205; + private _m0 = _display displayCtrl 1205; _m0 ctrlSetText "#(argb,8,8,3)color(1,1,1,1)"; _m0 ctrlSetPosition [ 0, @@ -612,7 +612,7 @@ if (_isNight) then { _h ]; _m0 ctrlCommit 0; - _text_m = _display displayCtrl 1003; + private _text_m = _display displayCtrl 1003; _text_m ctrlSetPosition [ 0, _h * 3, diff --git a/addons/difficulty/CfgEventHandlers.hpp b/addons/difficulty/CfgEventHandlers.hpp index 982b03f..a6cc6c5 100644 --- a/addons/difficulty/CfgEventHandlers.hpp +++ b/addons/difficulty/CfgEventHandlers.hpp @@ -5,4 +5,4 @@ class Extended_InitPost_EventHandlers { class Tank { init = "(_this select 0) allowCrewInImmobile true"; }; -}; \ No newline at end of file +}; diff --git a/addons/difficulty/CfgSurfaces.hpp b/addons/difficulty/CfgSurfaces.hpp index ba899b3..eb498a1 100644 --- a/addons/difficulty/CfgSurfaces.hpp +++ b/addons/difficulty/CfgSurfaces.hpp @@ -2,4 +2,4 @@ class CfgSurfaces { class Default { AIAvoidStance = 1; // less likely prone }; -}; \ No newline at end of file +}; diff --git a/addons/difficulty/config.cpp b/addons/difficulty/config.cpp index 92e71d6..a63b5fd 100644 --- a/addons/difficulty/config.cpp +++ b/addons/difficulty/config.cpp @@ -14,4 +14,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgDifficulty.hpp" #include "CfgAISkill.hpp" -#include "CfgSurfaces.hpp" \ No newline at end of file +#include "CfgSurfaces.hpp" diff --git a/addons/jrm/CfgEventHandlers.hpp b/addons/jrm/CfgEventHandlers.hpp index efd300d..11ba9cc 100644 --- a/addons/jrm/CfgEventHandlers.hpp +++ b/addons/jrm/CfgEventHandlers.hpp @@ -13,7 +13,7 @@ class Extended_PreInit_EventHandlers { class Extended_Killed_EventHandlers { class CAManBase { class ADDON { - clientKilled = QUOTE(_this call FUNC(handleKilled)); + clientKilled = QUOTE(call FUNC(handleKilled)); }; }; }; @@ -21,7 +21,7 @@ class Extended_Killed_EventHandlers { class Extended_Respawn_EventHandlers { class CAManBase { class ADDON { - clientRespawn = QUOTE(_this call FUNC(handleRespawn)); + clientRespawn = QUOTE(call FUNC(handleRespawn)); }; }; }; diff --git a/addons/jrm/functions/fnc_forceRespawn.sqf b/addons/jrm/functions/fnc_forceRespawn.sqf index 36bcf8d..e3ebc92 100644 --- a/addons/jrm/functions/fnc_forceRespawn.sqf +++ b/addons/jrm/functions/fnc_forceRespawn.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" params ["_positionOrCode", ["_resetState", false]]; -if (isServer && {_resetState}) then { +if (isServer && _resetState) then { GVAR(state) = [true] call CBA_fnc_createNamespace; publicVariable QGVAR(state); }; diff --git a/addons/logging/functions/fnc_fired.sqf b/addons/logging/functions/fnc_fired.sqf index 833abc9..cd02197 100644 --- a/addons/logging/functions/fnc_fired.sqf +++ b/addons/logging/functions/fnc_fired.sqf @@ -2,13 +2,13 @@ params ["_unit", "", "_muzzle", "", "", "", ["_proj", objNull]]; if (_muzzle != "HandGrenadeMuzzle" || - {GVAR(disabled)} || + GVAR(disabled) || {isNull _proj} || {!(_unit call EFUNC(common,isPlayer))} ) exitWith {}; // Clean up previous tracked nades -if (count (GVAR(grenades) select {!(isNull (_x select 0))}) == 0) then { +if ((GVAR(grenades) select {!(isNull (_x select 0))}) isEqualTo []) then { GVAR(grenades) = []; }; diff --git a/addons/logging/functions/fnc_handleDamage.sqf b/addons/logging/functions/fnc_handleDamage.sqf index 8759065..b9eb396 100644 --- a/addons/logging/functions/fnc_handleDamage.sqf +++ b/addons/logging/functions/fnc_handleDamage.sqf @@ -19,7 +19,7 @@ if (_lastShooter == _shooter && {time < _t}) exitWith {}; GVAR(playerDamageTimeout) = [_shooter, time + 1]; private _text = []; -_veh = vehicle _shooter; +private _veh = vehicle _shooter; if !(_veh isKindOf "CAManBase") then { private _info = fullCrew _veh select {(_x select 0) == _shooter}; (_info select 0) params ["", ["_role", "unknown"], "", ["_tpath", "unknown"]]; diff --git a/addons/logging/functions/fnc_killed.sqf b/addons/logging/functions/fnc_killed.sqf index 749a41c..73c213f 100644 --- a/addons/logging/functions/fnc_killed.sqf +++ b/addons/logging/functions/fnc_killed.sqf @@ -13,7 +13,7 @@ private _keepChecking = true; private _lvl = 0; // died directly by player gunfire -if (_unit != _killer && {_killerPlayer} && {(vehicle _killer) isKindOf "CAManBase"}) then { +if (_unit != _killer && _killerPlayer && {(vehicle _killer) isKindOf "CAManBase"}) then { private _wep = currentWeapon _killer; private _text = format ["Killed by %1, MAYBE using: %2, pos: %3 dist: %4, killer dir: %5", name _killer, @@ -42,7 +42,7 @@ if (_keepChecking && (_unit == _killer || {!_killerPlayer})) then { // killed by vehicle, use effectiveCommander like vanilla does if ((!isNull _killer) && {!((vehicle _killer) isKindOf "CAManBase")}) then { - private _text = format ["Killed by vehicle: %1", getText (configFile >> "CfgVehicles" >> (typeOf _killer) >> "displayName")]; + private _text = format ["Killed by vehicle: %1", getText (configOf _killer >> "displayName")]; private _plrCrew = (fullCrew _killer) select { _x params ["_obj", "_role"]; (_role != "cargo" && {_obj call EFUNC(common,isPlayer)}) @@ -52,7 +52,7 @@ if (_keepChecking && (_unit == _killer || {!_killerPlayer})) then { }; _killer = effectiveCommander _killer; - if (count _plrCrew > 0) then { + if (_plrCrew isNotEqualTo []) then { _lvl = [0, 2] select (_sideGrp == side group _killer); _text = _text + format [", crew: (%1)", _plrCrew joinString (', ')]; }; @@ -62,7 +62,7 @@ if (_keepChecking && (_unit == _killer || {!_killerPlayer})) then { // killed by AI if (_unit != _killer && {!(_killer call EFUNC(common,isPlayer))}) then { _lvl = 0; - _msg pushBack format ["Killed by AI(%1)", getText (configFile >> "CfgVehicles" >> (typeOf _killer) >> "displayName")]; + _msg pushBack format ["Killed by AI(%1)", getText (configOf _killer >> "displayName")]; }; // still "suicide". get nearby player drivers @@ -70,7 +70,7 @@ if (_keepChecking && (_unit == _killer || {!_killerPlayer})) then { private _nearbyDrivers = (nearestObjects [getPosATL _unit, ["LandVehicle", "Air"], 20]) select {(driver _x) call EFUNC(common,isPlayer)}; - if (count _nearbyDrivers > 0) then { + if (_nearbyDrivers isNotEqualTo []) then { private _withDist = _nearbyDrivers apply {[_x, _x distance _unit]}; private _sorted = [_withDist, 1] call CBA_fnc_sortNestedArray; diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 3e53cba..5a02c2a 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -8,8 +8,10 @@ #define PATCHLVL 0 #define BUILD 0 -#define VERSION MAJOR.MINOR.PATCHLVL.BUILD -#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD +#define VERSION MAJOR.MINOR +#define VERSION_STR MAJOR.MINOR.PATCHLVL.BUILD +#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD +#define VERSION_PLUGIN MAJOR.MINOR.PATCHLVL.BUILD #define FPA_TAG FPA diff --git a/addons/message_ui/functions/fnc_initListbox.sqf b/addons/message_ui/functions/fnc_initListbox.sqf index 62d000b..846563a 100644 --- a/addons/message_ui/functions/fnc_initListbox.sqf +++ b/addons/message_ui/functions/fnc_initListbox.sqf @@ -19,7 +19,7 @@ private _fnc_addHeadline = { private _fnc_addEntry = { params ["_text","_data"]; private _index = _ctrl lbAdd _text; - _ctrl lbSetData [_index,if !(_data isEqualType "") then {str _data} else {_data}]; + _ctrl lbSetData [_index, if (_data isEqualType "") then {_data} else {str _data}]; _index }; diff --git a/addons/saveMarkers/functions/fnc_onDraw.sqf b/addons/saveMarkers/functions/fnc_onDraw.sqf index c533784..e6a7f99 100644 --- a/addons/saveMarkers/functions/fnc_onDraw.sqf +++ b/addons/saveMarkers/functions/fnc_onDraw.sqf @@ -13,6 +13,7 @@ params ["_mapCtrl"]; ] } forEach GVAR(selectedMarkers); +private _textPos = []; { _textPos = _mapCtrl ctrlMapScreenToWorld ((_mapCtrl ctrlMapWorldToScreen (getMarkerPos _x)) apply {_x + 0.02}); diff --git a/addons/saveMarkers/functions/fnc_onMouseButtonDownMap.sqf b/addons/saveMarkers/functions/fnc_onMouseButtonDownMap.sqf index 5ce2d60..d313c4d 100644 --- a/addons/saveMarkers/functions/fnc_onMouseButtonDownMap.sqf +++ b/addons/saveMarkers/functions/fnc_onMouseButtonDownMap.sqf @@ -14,8 +14,8 @@ GVAR(selectDrawEH) = _mapCtrl ctrlAddEventHandler ["Draw",{ (_mapCtrl ctrlMapScreenToWorld getMousePosition) params ["_currentMouseX","_currentMouseY"]; GVAR(mouseDragStart) params ["_startMouseX","_startMouseY"]; - _halfDeltaX = (_currentMouseX - _startMouseX)/2; - _halfDeltaY = (_currentMouseY - _startMouseY)/2; + private _halfDeltaX = (_currentMouseX - _startMouseX)/2; + private _halfDeltaY = (_currentMouseY - _startMouseY)/2; _mapCtrl drawRectangle [[_startMouseX + _halfDeltaX,_startMouseY + _halfDeltaY],_halfDeltaX,_halfDeltaY,0,[0,0,0,1],""]; }]; diff --git a/addons/saveMarkers/functions/fnc_saveMarkers.sqf b/addons/saveMarkers/functions/fnc_saveMarkers.sqf index 223857c..fee4ac8 100644 --- a/addons/saveMarkers/functions/fnc_saveMarkers.sqf +++ b/addons/saveMarkers/functions/fnc_saveMarkers.sqf @@ -42,4 +42,4 @@ _thisDataMarkersArray resize 0; saveProfileNamespace; -_newSaveID +nil diff --git a/addons/saveMarkers/functions/fnc_updateSavesList.sqf b/addons/saveMarkers/functions/fnc_updateSavesList.sqf index 449993a..abde000 100644 --- a/addons/saveMarkers/functions/fnc_updateSavesList.sqf +++ b/addons/saveMarkers/functions/fnc_updateSavesList.sqf @@ -19,8 +19,8 @@ private _saveMarkersData = profileNamespace getVariable [QGVAR(saveData),[]]; private _rowID = _ctrlSavesList lnbAddRow [_saveAs,_worldName]; _ctrlSavesList lnbSetValue [[_rowID,0],_forEachIndex]; - _textColor = [[0.50,0.50,0.50,1],[1,1,1,1]] select (_worldName == worldName); + private _textColor = [[0.50,0.50,0.50,1],[1,1,1,1]] select (_worldName == worldName); {_ctrlSavesList lnbSetColor [[_rowID,_x],_textColor]} forEach [0,1]; } forEach _saveMarkersData; -_ctrlSavesList lnbSetCurSelRow _selID; +// _ctrlSavesList lnbSetCurSelRow _selID; diff --git a/addons/saveMarkers/ui/dialog.hpp b/addons/saveMarkers/ui/dialog.hpp index 53ad6e6..60bccc7 100644 --- a/addons/saveMarkers/ui/dialog.hpp +++ b/addons/saveMarkers/ui/dialog.hpp @@ -1,10 +1,10 @@ #include "defines.hpp" class RscMapControl; -class RscPicture; +// class RscPicture; class RscText; class RscTitle; -class RscActiveText; +// class RscActiveText; class RscControlsGroupNoScrollbars; class RscEdit; class RscListNBox; @@ -17,7 +17,7 @@ class GVAR(RscDisplayMarkers) { idd = IDD_SAVEMARKERS; movingEnable = 0; - onUnload = QUOTE(_this call FUNC(onUnload)); + onUnload = QUOTE(call FUNC(onUnload)); class controlsBackground { class map: RscMapControl { @@ -70,7 +70,7 @@ class GVAR(RscDisplayMarkers) { sizeEx = QUOTE(0.8 * Y_FACTOR); - class Attributes; + // class Attributes; }; }; }; @@ -152,8 +152,8 @@ class GVAR(RscDisplayMarkers) { sizeEx = QUOTE(0.8 * Y_FACTOR); columns[] = {0,0.7}; - class ListScrollBar; - class ScrollBar; + // class ListScrollBar; + // class ScrollBar; }; class buttonCancel: RscButtonMenu { diff --git a/include/x/cba/addons/xeh/script_xeh.hpp b/include/x/cba/addons/xeh/script_xeh.hpp index f2282ec..9b483e8 100644 --- a/include/x/cba/addons/xeh/script_xeh.hpp +++ b/include/x/cba/addons/xeh/script_xeh.hpp @@ -129,4 +129,4 @@ visionModeChanged = ""; \ weaponAssembled = ""; \ weaponDisassembled = ""; \ weaponDeployed = ""; \ -weaponRested = ""; \ No newline at end of file +weaponRested = ""; diff --git a/include/z/ace/addons/main/script_macros.hpp b/include/z/ace/addons/main/script_macros.hpp index 43fc16b..ed3a826 100644 --- a/include/z/ace/addons/main/script_macros.hpp +++ b/include/z/ace/addons/main/script_macros.hpp @@ -172,4 +172,4 @@ class ace_notLoaded { \ NAME = CAUSE; \ }; -#include "script_debug.hpp" \ No newline at end of file +#include "script_debug.hpp" diff --git a/optionals/compositions/CfgGroups.hpp b/optionals/compositions/CfgGroups.hpp index f7f0b74..657b9d9 100644 --- a/optionals/compositions/CfgGroups.hpp +++ b/optionals/compositions/CfgGroups.hpp @@ -26,4 +26,4 @@ class CfgGroups }; }; }; -}; \ No newline at end of file +};