Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ workshop = [
parameters = [
"-world=empty"
]

[lints.sqf.var_all_caps]
enabled = true
options.ignore = [
"ACRE_IS_SPECTATOR"
]
2 changes: 1 addition & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Cuel


# CONTRIBUTORS
diwako
diwako
8 changes: 4 additions & 4 deletions addons/ai/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
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;
effectsMissile = "missile3";
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;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class CfgPatches {
};

#include "CfgAmmo.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgEventHandlers.hpp"
6 changes: 3 additions & 3 deletions addons/ai/functions/fnc_forceMoveWp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions addons/ai/functions/fnc_spawnGroups.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ private _newGroups = [];

{
_type = _x;
_amount = _backpackCargo#1#_forEachIndex;
private _amount = _backpackCargo#1#_forEachIndex;
_veh addBackpackCargoGlobal [_type, _amount];
} forEach _backpackCargo#0;

{
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];
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/ares/functions/fnc_ai.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
3 changes: 2 additions & 1 deletion addons/ares/functions/fnc_ejectCargo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/ares/functions/fnc_proximityIed.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions addons/ares/zenModules.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions addons/axe/functions/fnc_findTrunk.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand All @@ -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;
{
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions addons/axe/functions/fnc_interactEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion addons/common/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};
};

2 changes: 1 addition & 1 deletion addons/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_copyAllGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand Down
5 changes: 3 additions & 2 deletions addons/common/functions/fnc_disableWeapons.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand All @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_initViewDistance.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions addons/common/functions/fnc_respawnMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};
};

Expand Down
Loading
Loading