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
4 changes: 2 additions & 2 deletions addons/ai/functions/fnc_garrison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (_startingPos isEqualTo [0,0,0]) exitWith {
[LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured);
};

if (count _unitsArray == 0 || {isNull (_unitsArray select 0)}) exitWith {
if (_unitsArray isEqualTo [] || {isNull (_unitsArray select 0)}) exitWith {
TRACE_1("fnc_garrison: Units error",_unitsArray);
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
};
Expand All @@ -43,7 +43,7 @@ if (_fillingRadius >= 50) then {
_buildings = [_buildings] call CBA_fnc_shuffle;
};

if (count _buildings == 0) exitWith {
if (_buildings isEqualTo []) exitWith {
TRACE_1("fnc_garrison: Building error",_buildings);
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
};
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_switchToGroupSide.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (_switch) then {
private _newGroup = createGroup (_x select 1);
[_unit] joinSilent _newGroup;
};
if (count units _currentGroup == 0) then {
if (units _currentGroup isEqualTo []) then {
deleteGroup _currentGroup;
};
_previousGroupsList set [_forEachIndex, objNull];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (_insertChildrenCode isNotEqualTo {}) then {
// Collect dynamic children class actions
{
private _action = [_x select 2, _x, _fullPath, _distanceToBasePoint] call FUNC(collectActiveActionTree);
if ((count _action) > 0) then {
if (_action isNotEqualTo []) then {
_activeChildren pushBack _action;
};
} forEach _dynamicChildren;
Expand All @@ -73,7 +73,7 @@ if (_insertChildrenCode isNotEqualTo {}) then {
// Collect children class actions
{
private _action = [_object, _x, _fullPath, _distanceToBasePoint] call FUNC(collectActiveActionTree);
if ((count _action) > 0) then {
if (_action isNotEqualTo []) then {
_activeChildren pushBack _action;
};
} forEach _origActionChildren;
Expand All @@ -85,7 +85,7 @@ if (_insertChildrenCode isNotEqualTo {}) then {
// Check if the action is children of the original action
if (_pPath isEqualTo _fullPath) then {
private _action = [_object, [_actionData,[]], _fullPath, _distanceToBasePoint] call FUNC(collectActiveActionTree);
if ((count _action) > 0) then {
if (_action isNotEqualTo []) then {
_activeChildren pushBack _action;
};
};
Expand Down
4 changes: 2 additions & 2 deletions addons/interaction/functions/fnc_getDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ params ["_unit", "_target"];

[_unit, "GestureGo"] call EFUNC(common,doGesture);

private _chance = [0.5, 0.8] select (count weapons _unit > 0);
private _chance = [0.5, 0.8] select (weapons _unit isNotEqualTo []);

{
if (count weapons _x == 0 && {random 1 < _chance}) then {
if (weapons _x isEqualTo [] && {random 1 < _chance}) then {
[QGVAR(getDown), [_x], [_x]] call CBA_fnc_targetEvent;
};
} forEach (_target nearEntities ["Civilian", SEND_RADIUS]);
4 changes: 2 additions & 2 deletions addons/interaction/functions/fnc_sendAway.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ params ["_unit"];

[_unit, "GestureGo"] call EFUNC(common,doGesture);

private _chance = [0.5, 0.8] select (count weapons _unit > 0);
private _chance = [0.5, 0.8] select (weapons _unit isNotEqualTo []);

{
if (count weapons _x == 0 && {random 1 < _chance}) then {
if (weapons _x isEqualTo [] && {random 1 < _chance}) then {
private _position = getPosASL _unit vectorAdd (eyeDirection _unit vectorMultiply SEND_DISTANCE);
_position set [2, 0];

Expand Down
2 changes: 1 addition & 1 deletion addons/laser/functions/fnc_seekerFindLaserSpot.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private _finalOwner = objNull;

TRACE_2("",count _spots,_spots);

if ((count _spots) > 0) then {
if (_spots isNotEqualTo []) then {
private _bucketList = nil;
private _bucketPos = nil;
private _c = 0;
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_damage/functions/fnc_interpolatePoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
params ["_input", "_points", ["_randomRound", false]];

if (count _points < 1) exitWith {
if (_points isEqualTo []) exitWith {
//TODO: sensible default/error value
0
};
Expand Down
3 changes: 1 addition & 2 deletions addons/missileguidance/functions/fnc_seekerType_ARH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then {
};
_nearestObjects = _nearestObjects select { !isNull _x };
// Select closest object to the expected position to be the current radar target
if ((count _nearestObjects) <= 0) exitWith {
if (_nearestObjects isEqualTo []) exitWith {
_projectile setMissileTarget objNull;
_searchPos
};
Expand Down Expand Up @@ -117,4 +117,3 @@ if !(isNull _target) then {

_launchParams set [0, _target];
_expectedTargetPos

4 changes: 2 additions & 2 deletions addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private _missionRoot = str missionConfigFile select [0, count str missionConfigF
};
} forEach _splittedList;

if (count _ambianceSounds == 0) exitWith {};
if (_ambianceSounds isEqualTo []) exitWith {};
{
if ((_x find ".") == -1) then {
_ambianceSounds set [_forEachIndex, _x + ".wss"];
Expand All @@ -80,7 +80,7 @@ TRACE_1("",_ambianceSounds);
private _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]};

// Check if there are enough players to even start playing this sound.
if (count _allUnits > 0) then {
if (_allUnits isNotEqualTo []) then {
// find the position from which we are going to play this sound from.
private _newPosASL = if (_followPlayers) then {
// Select a target unit at random.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (_weaponBarrelClass == "") then {
// Find all spare barrel the player has
private _allBarrels = [_assistant, _weaponBarrelClass] call CBA_fnc_getMagazineIndex;
TRACE_1("_allBarrels",_allBarrels);
if ((count _allBarrels) < 1) exitWith {};
if (_allBarrels isEqualTo []) exitWith {};

// Determine which on is coolest
private _coolestTemp = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (_weaponBarrelClass == "") then {
};
private _allBarrels = [_unit, _weaponBarrelClass] call CBA_fnc_getMagazineIndex;
TRACE_1("_allBarrels",_allBarrels);
if ((count _allBarrels) < 1) exitWith {};
if (_allBarrels isEqualTo []) exitWith {};

// Determine the temp of each barrel
private _temps = [];
Expand Down
2 changes: 1 addition & 1 deletion addons/rangecard/functions/fnc_updateRangeCard.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private _barrelLength = _weaponConfig select 2;
private _muzzleVelocity = 0;

private _bc = 0;
if (count (_ammoConfig select 6) > 0) then {
if ((_ammoConfig select 6) isNotEqualTo []) then {
_bc = (_ammoConfig select 6) select 0;
};
private _transonicStabilityCoef = _ammoConfig select 4;
Expand Down
2 changes: 1 addition & 1 deletion addons/repair/functions/fnc_canRepair.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then {
if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false};

private _items = _config call FUNC(getRepairItems);
if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false};
if (_items isNotEqualTo [] && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false};

private _return = true;
if (getText (_config >> "condition") != "") then {
Expand Down
12 changes: 2 additions & 10 deletions addons/repair/functions/fnc_getHitPointString.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,9 @@
*/

params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]];
_trackArray params [["_trackNames", []], ["_trackStrings", []], ["_trackAmount", []]];

private _track = (count _trackArray > 0);
private _trackNames = [];
private _trackStrings = [];
private _trackAmount = [];

if (_track) then {
_trackNames = _trackArray select 0;
_trackStrings = _trackArray select 1;
_trackAmount = _trackArray select 2;
};
private _track = _trackArray isNotEqualTo [];

// Prepare first part of the string from stringtable
//IGNORE_STRING_WARNING(str_ace_repair_hit);
Expand Down
2 changes: 1 addition & 1 deletion addons/repair/functions/fnc_repair.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if ((isEngineOn _target) && {!GVAR(autoShutOffEngineWhenStartingRepair)}) exitWi
};

private _items = _config call FUNC(getRepairItems);
if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false};
if (_items isNotEqualTo [] && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false};

private _return = true;
if (getText (_config >> "condition") != "") then {
Expand Down
2 changes: 1 addition & 1 deletion addons/spottingscope/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CfgVehicles {
selection = "";
displayName = CSTRING(PickUp);
distance = 5;
condition = QUOTE((alive _target) && (count (crew _target) == 0));
condition = QUOTE((alive _target) && {(crew _target) isEqualTo []});
statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup));
showDisabled = 0;
exceptions[] = {};
Expand Down
2 changes: 1 addition & 1 deletion addons/switchunits/functions/fnc_switchUnit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (GVAR(EnableSafeZone)) then {
private _allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers);
private _nearestEnemyPlayers = _allNearestPlayers select {((side GVAR(OriginalGroup)) getFriend side _x < 0.6) && !(_x getVariable [QGVAR(IsPlayerControlled), false])};

if (count _nearestEnemyPlayers > 0) exitWith {
if (_nearestEnemyPlayers isNotEqualTo []) exitWith {
_leave = true;
};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/vehicle_damage/functions/fnc_processHit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private _chanceOfDetonation = 0;
private _explosiveAmmoCount = 0;
private _nonExplosiveAmmoCount = 0;

if (count (_currentVehicleAmmo select 0) isNotEqualTo 0) then {
if ((_currentVehicleAmmo select 0) isNotEqualTo []) then {
private _magConfig = configFile >> "CfgMagazines";
private _ammoConfig = configFile >> "CfgAmmo";
private _countOfExplodableAmmo = 0;
Expand Down
2 changes: 1 addition & 1 deletion addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (_useCustom) then {
private _previousMags = magazinesDetail _unit;
_unit addMagazine ["ACE_key_customKeyMagazine", 1]; //addMagazine array has global effects
private _newMags = (magazinesDetail _unit) - _previousMags;
if ((count _newMags) == 0) exitWith {ERROR("failed to add magazine (inventory full?)");};
if (_newMags isEqualTo []) exitWith {ERROR("failed to add magazine (inventory full?)");};
private _keyMagazine = _newMags select 0;
TRACE_2("setting up key on server",_veh,_keyMagazine);
//Have the server run add the key to the vehicle's key array:
Expand Down
2 changes: 1 addition & 1 deletion addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private _weapons = _vehicle weaponsTurret _turret;

if (
count _weapons > 1
|| {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ...
|| {_weapons isNotEqualTo [] && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ...
) then {
//This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead.

Expand Down
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_moduleSuppressiveFire.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith {
} else {
// Direct fire - Get a target position that will work
private _lis = lineIntersectsSurfaces [eyePos _unit, _targetASL, _unit, _vehicle];
if ((count _lis) > 0) then { // If point is hidden, unit won't fire, do a ray cast to find where they should shoot at
if (_lis isNotEqualTo []) then { // If point is hidden, unit won't fire, do a ray cast to find where they should shoot at
_targetASL = ((_lis select 0) select 0);
TRACE_1("using ray cast pos",_mousePosASL distance _targetASL);
};
Expand Down