All - Fix parentheses around code (#10073)

* Fix Brackets around code

* Update fnc_handleFired.sqf

* Shouldn't have changed this one

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
Mike-MF 2024-06-18 15:08:03 +01:00 committed by GitHub
parent 8fc093de8f
commit 1c6c4d6bff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
100 changed files with 189 additions and 175 deletions

View File

@ -19,7 +19,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);
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if !(_ammo isKindOf "BulletBase") exitWith {};
if (!alive _projectile) exitWith {};
if (underwater _unit) exitWith {};

View File

@ -40,7 +40,7 @@ if (_transonicStabilityCoef == 0) then {
_transonicStabilityCoef = 0.5;
};
private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel");
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
if !(_dragModel in [1, 2, 5, 6, 7, 8]) then {
_dragModel = 1;
};
private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");

View File

@ -13,7 +13,7 @@ GVAR(tempWindInfo) = false;
// Add keybinds
["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), {
// Condition
if (!([ACE_player] call FUNC(canPrepare))) exitWith {false};
if !([ACE_player] call FUNC(canPrepare)) exitWith {false};
if (EGVAR(common,isReloading)) exitWith {true};
// Statement

View File

@ -21,7 +21,7 @@ TRACE_1("params",_unit);
// Select next throwable if one already in hand
if (_unit getVariable [QGVAR(inHand), false]) exitWith {
TRACE_1("inHand",_unit);
if (!(_unit getVariable [QGVAR(primed), false])) then {
if !(_unit getVariable [QGVAR(primed), false]) then {
TRACE_1("not primed",_unit);
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
// selectNextGrenade relies on muzzles array (setAmmo 0 removes the muzzle from the array and current can't be found, cycles between 0 and 1 muzzles)

View File

@ -20,7 +20,7 @@ TRACE_1("params",_unit);
// Prime the throwable if it hasn't been cooking already
// Next to proper simulation this also has to happen before delay for orientation of the throwable to be set
if (!(_unit getVariable [QGVAR(primed), false])) then {
if !(_unit getVariable [QGVAR(primed), false]) then {
[_unit] call FUNC(prime);
};

View File

@ -72,6 +72,6 @@ if (_nextAction != GVAR(currentAction)) then {
GVAR(currentAction) = _nextAction;
};
if (!(GVAR(currentAction) in ["Civil", "Salute"])) then {
if !(GVAR(currentAction) in ["Civil", "Salute"]) then {
GVAR(center) selectWeapon ([primaryWeapon GVAR(center), secondaryWeapon GVAR(center), handgunWeapon GVAR(center), binocular GVAR(center)] select GVAR(selectedWeaponType)); // select correct weapon, prevents floating weapons
};

View File

@ -25,7 +25,7 @@
params ["_vehicle", "", "", "", "", "_magazine", "_projectile", "_gunner"];
TRACE_4("firedEH",_vehicle,_magazine,_projectile,_gunner);
if (!([_gunner] call EFUNC(common,isPlayer))) exitWith {}; // AI don't know how to use (this does give them more range than a player)
if !([_gunner] call EFUNC(common,isPlayer)) exitWith {}; // AI don't know how to use (this does give them more range than a player)
if ((gunner _vehicle) != _gunner) exitWith {}; // check if primaryGunner

View File

@ -19,7 +19,7 @@ params ["_menuType"];
TRACE_1("interactMenuOpened",_menuType);
if (_menuType != 1) exitWith {};
if (!("ACE_artilleryTable" in (ace_player call EFUNC(common,uniqueItems)))) exitWith {};
if !("ACE_artilleryTable" in (ace_player call EFUNC(common,uniqueItems))) exitWith {};
private _vehicleAdded = ace_player getVariable [QGVAR(vehiclesAdded), []];
private _rangeTablesShown = ace_player getVariable [QGVAR(rangeTablesShown), []];

View File

@ -23,7 +23,7 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) ==
_resetGunList = false;
{
// Verify each gun has correct param type
if (!(_x isEqualTypeArray ["", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", [], [], false])) exitWith {
if !(_x isEqualTypeArray ["", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", [], [], false]) exitWith {
_resetGunList = true;
};
} forEach GVAR(gunList);

View File

@ -74,7 +74,7 @@ private _validate_preset = {
ERROR(_errorMsg);
_valid = false;
};
if (!((_this select 17) in ["ASM", "ICAO"])) then {
if !((_this select 17) in ["ASM", "ICAO"]) then {
private _errorMsg = format ["Invalid atmosphere model: %1", _this select 17];
ERROR(_errorMsg);
_valid = false;

View File

@ -26,7 +26,7 @@ if !(ctrlVisible 9000) then {
params ["_args"];
_args params ["_startTime"];
if (!(GVAR(speedAssistTimer))) exitWith {
if !(GVAR(speedAssistTimer)) exitWith {
GVAR(speedAssistTimer) = true;
ctrlSetText [8006, Str(Round((CBA_missionTime - _startTime) * 10) / 10)];

View File

@ -15,7 +15,7 @@
* Public: No
*/
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {};
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {};
if (ctrlVisible 17000) then {
false call FUNC(show_c1_ballistic_coefficient_data);

View File

@ -15,7 +15,7 @@
* Public: No
*/
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {};
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {};
if (ctrlVisible 16000) then {
false call FUNC(show_muzzle_velocity_data);

View File

@ -15,7 +15,7 @@
* Public: No
*/
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {};
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {};
if (ctrlVisible 18000) then {
false call FUNC(show_truing_drop);

View File

@ -35,7 +35,7 @@ if (!GVAR(atmosphereModeTBH)) then {
_relativeHumidity = 0.5;
};
private _scopeBaseAngle = if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then {
private _scopeBaseAngle = if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight];
(parseNumber _zeroAngle)
} else {

View File

@ -28,7 +28,7 @@ if (_attachedList isEqualTo []) exitWith {};
TRACE_2("detaching",_xObject,_deadUnit);
detach _xObject;
//If it's a vehicle, also delete the attached
if (!(_deadUnit isKindOf "CAManBase")) then {
if !(_deadUnit isKindOf "CAManBase") then {
_xObject setPos ((getPos _deadUnit) vectorAdd [0, 0, -1000]);
[{deleteVehicle (_this select 0)}, [_xObject], 2] call CBA_fnc_waitAndExecute;
};

View File

@ -44,7 +44,7 @@ if (_state) then {
};
};
if (!(_unit getVariable [QGVAR(isEscorting), false])) then {
if !(_unit getVariable [QGVAR(isEscorting), false]) then {
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
[objNull, _target, false] call EFUNC(common,claim);
detach _target;

View File

@ -58,7 +58,7 @@ if (_state) then {
// fix anim on mission start (should work on dedicated servers)
[{
params ["_unit"];
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) exitWith {};
if !(_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {};
if ((vehicle _unit) == _unit) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);

View File

@ -81,7 +81,7 @@ if (_state) then {
if (_unit == ACE_player) then {
//only re-enable HUD if not handcuffed
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
if !(_unit getVariable [QGVAR(isHandcuffed), false]) then {
["captive", []] call EFUNC(common,showHud); //same as showHud true;
};
};

View File

@ -50,7 +50,7 @@ private _allWeapons = [];
private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgVehicles");
{
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLowerANSI configName _x) in _allUnits)) then {
if !((toLowerANSI configName _x) in _allUnits) then {
WARNING_2("Not in any units[] - %1 from %2",configName _x,configSourceMod _x);
_testPass = false;
};
@ -62,7 +62,7 @@ private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (config
{
private _type = toLowerANSI configName _x;
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLowerANSI configName _x) in _allWeapons)) then {
if !((toLowerANSI configName _x) in _allWeapons) then {
WARNING_2("Not in any weapons[] - %1 from %2",configName _x,configSourceMod _x);
_testPass = false;
};

View File

@ -24,7 +24,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi
if (isNil "_defaultGlobal") exitWith {};
if (!(_name isEqualType "")) exitwith {
if !(_name isEqualType "") exitwith {
[format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug);
};

View File

@ -56,7 +56,7 @@ private _resultMask = [];
for "_index" from 0 to 9 do {
private _set = true; //Default to true
{
if (!(_x select _index)) exitWith {
if !(_x select _index) exitWith {
_set = false; //Any false will make it false
};
} forEach _masks;

View File

@ -14,7 +14,9 @@
*
* Public: No
*/
params ["_trap"];
if !(GETEGVAR(medical,enabled,false)) exitWith {};
private _radius = getNumber (configOf _trap >> "indirectHitRange");

View File

@ -22,7 +22,7 @@
params ["_wire", "", "_damage", "_source", ""];
if (_damage < 0.5) exitWith { 0 };
if (!(isNull _source)) then {
if (!isNull _source) then {
_wire setVariable [QGVAR(lastDamager), _source];
};

View File

@ -25,7 +25,7 @@ params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_re
TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo);
TRACE_2("",local _vehicle,_vehicle turretLocal _turret);
if (!(_vehicle turretLocal _turret)) exitWith {};
if !(_vehicle turretLocal _turret) exitWith {};
([_vehicle, _turret, _carryMag] call FUNC(reload_canLoadMagazine)) params ["_canAdd", "_loadedMag", "_neededAmmo", "_isBeltLinking"];
TRACE_4("canLoad",_canAdd,_loadedMag,_neededAmmo,_isBeltLinking);

View File

@ -24,7 +24,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);
if (!(_vehicle turretLocal _turretPath)) exitWith {};
if !(_vehicle turretLocal _turretPath) exitWith {};
private _magsInWeapon = []; // Check how much ammo it has now:
{

View File

@ -30,7 +30,7 @@ private _fncSumArray = {
};
//Sanity Checks
if (!([_target] call FUNC(canBeDisarmed))) exitWith {
if !([_target] call FUNC(canBeDisarmed)) exitWith {
[_caller, _target, "Debug: Cannot disarm target"] call FUNC(eventTargetFinish);
};
if (_doNotDropAmmo && {({_x in _listOfItemsToRemove} count (magazines _target)) > 0}) exitWith {
@ -74,7 +74,6 @@ if (_holder getVariable [QGVAR(holderInUse), false]) exitWith {
};
_holder setVariable [QGVAR(holderInUse), true];
//Remove Magazines
private _targetMagazinesStart = magazinesAmmo _target;
private _holderMagazinesStart = magazinesAmmoCargo _holder;
@ -96,7 +95,7 @@ if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "Cfg
[_caller, _target, "Debug: Didn't Remove Magazines"] call FUNC(eventTargetFinish);
};
//Verify holder has mags unit had
if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holderMagazinesEnd] call FUNC(verifyMagazinesMoved))) then {
if !([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holderMagazinesEnd] call FUNC(verifyMagazinesMoved)) then {
_holder setVariable [QGVAR(holderInUse), false];
[_caller, _target, "Debug: Crate Magazines not in holder"] call FUNC(eventTargetFinish);
};
@ -238,7 +237,7 @@ if (_holderIsEmpty) then {
[_caller, _target, "Debug: Drop Actions Timeout"] call FUNC(eventTargetFinish);
};
//If target lost disarm status:
if (!([_target] call FUNC(canBeDisarmed))) exitWith {
if !([_target] call FUNC(canBeDisarmed)) exitWith {
_holder setVariable [QGVAR(holderInUse), false];
[_caller, _target, "Debug: Target cannot be disarmed"] call FUNC(eventTargetFinish);
};

View File

@ -32,7 +32,7 @@ private _itemsToAdd = [];
} forEach _listOfObjectsToRemove;
{
if (!(_x in _listOfObjectsToRemove)) then {
if !(_x in _listOfObjectsToRemove) then {
_listOfObjectsToRemove pushBack _x;
};
} forEach _itemsToAdd;

View File

@ -16,11 +16,14 @@
*
* Public: No
*/
params ["_caller", "_target"];
#define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa"
#define DEFAULTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa"
//Sanity Checks
if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");};
if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");};
if !([_player, _target] call FUNC(canPlayerDisarmUnit)) exitWith {ERROR("Can't Disarm Unit");};
if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;};
disableSerialization;
@ -74,8 +77,8 @@ GVAR(disarmTarget) = _target;
private _rankPicture = _display displayCtrl 1203;
//Show rank and name (just like BIS's inventory)
private _icon = format [DEFUALTPATH, toLowerANSI (rank _target)];
if (_icon isEqualTo DEFUALTPATH) then {_icon = ""};
private _icon = format [DEFAULTPATH, toLowerANSI (rank _target)];
if (_icon isEqualTo DEFAULTPATH) then {_icon = ""};
_rankPicture ctrlSetText _icon;
_playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName));

View File

@ -6,7 +6,7 @@
["vehicle", {
params ["","_vehicle"];
TRACE_2("vehicle change",_vehicle,typeOf _vehicle);
if (!(_vehicle isKindOf QGVAR(staticBase))) exitWith {};
if !(_vehicle isKindOf QGVAR(staticBase)) exitWith {};
_vehicle animate ["rest_rotate", 0];
@ -14,7 +14,7 @@
[GVAR(pfID)] call CBA_fnc_removePerFrameHandler;
private _lastView = cameraView;
if (!(_lastView in ["INTERNAL", "EXTERNAL"])) then { _lastView == "INTERNAL"; };
if !(_lastView in ["INTERNAL", "EXTERNAL"]) then { _lastView == "INTERNAL"; };
GVAR(pfID) = [{
params ["_args"];

View File

@ -21,7 +21,7 @@ params ["_target", "_unit", ["_event", false]];
TRACE_3("sightAttach",_target,_unit,_event);
if (_event isEqualTo true) then { // this is actually needed as 3rd arg may not be bool
if (!(_target turretLocal [0])) exitWith {};
if !(_target turretLocal [0]) exitWith {};
_target setVariable [QGVAR(sightAttached), true, true];
_target animate ["optic_hide", 0];
_target addWeapon QGVAR(superStatic);

View File

@ -23,7 +23,7 @@ params ["_target", "_unit", ["_event", false]];
TRACE_3("sightDetach",_target,_unit,_event);
if (_event isEqualTo true) then { // this is actually needed as 3rd arg may not be bool
if (!(_target turretLocal [0])) exitWith {};
if !(_target turretLocal [0]) exitWith {};
_target setVariable [QGVAR(sightAttached), false, true];
_target animate ["optic_hide", 1];
_target removeWeapon QGVAR(superStatic);

View File

@ -144,7 +144,7 @@ if (_detonator != "ACE_DeadManSwitch") then {
private _procressedMags = [];
{
private _mag = _x;
if (!(_mag in _procressedMags)) then {
if !(_mag in _procressedMags) then {
_procressedMags pushBack _x;
private _magConfig = configFile >> "CfgMagazines" >> _mag;
private _supportedTriggers = getArray (_magConfig >> "ACE_Triggers" >> "SupportedTriggers");

View File

@ -37,7 +37,7 @@ TRACE_2("placed",_deadman,_range);
//Handle deadman connected to explosive in inventory
private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""];
if (_connectedInventoryExplosive != "") then {
if (!(_connectedInventoryExplosive in (magazines _unit))) exitWith {};
if !(_connectedInventoryExplosive in (magazines _unit)) exitWith {};
//Remove mag and reset variable
_unit removeMagazine _connectedInventoryExplosive;

View File

@ -9,7 +9,7 @@
// Keybinds
["ACE3 Vehicles", QGVAR(fastRope), localize LSTRING(Interaction_fastRope), {
if ((vehicle ACE_player) == ACE_player) exitWith {false};
if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false};
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
if ([ACE_player, vehicle ACE_player] call FUNC(canFastRope)) then {
[ACE_player, vehicle ACE_player] call FUNC(fastRope);
true
@ -20,7 +20,7 @@
["ACE3 Vehicles", QGVAR(cutRopes), localize LSTRING(Interaction_cutRopes), {
if ((vehicle ACE_player) == ACE_player) exitWith {false};
if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false};
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
if ([vehicle ACE_player] call FUNC(canCutRopes)) then {
[vehicle ACE_player] call FUNC(cutRopes);
true
@ -43,7 +43,7 @@ if (isServer) then {
#ifdef DRAW_FASTROPE_INFO
addMissionEventHandler ["Draw3D", {
if (!(cursorObject isKindOf "Helicopter")) exitWith {};
if !(cursorObject isKindOf "Helicopter") exitWith {};
private _config = configOf cursorObject;
private _enabled = getNumber (_config >> QGVAR(enabled));
drawIcon3D ["", [.5,.5,1,1], (ASLtoAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"];

View File

@ -30,7 +30,7 @@ if !(IS_UNCONSCIOUS(_unit)) then {
_unit setVariable [QGVAR(indicatorIteration), _iteration];
};
if (!([_unit] call FUNC(isBurning)) || { !alive _unit }) then {
if (!([_unit] call FUNC(isBurning)) || {!alive _unit}) then {
[_pfhHandle] call CBA_fnc_removePerFrameHandler;
_unit setVariable [QGVAR(burnUIPFH), -1];
};

View File

@ -48,10 +48,10 @@ if IS_NUMBER(_preset) then { // Legacy support
};
private _budget = _logic getVariable ["Budget", -1];
if (!(_budget isEqualType 0)) then {_budget = -1};
if !(_budget isEqualType 0) then {_budget = -1};
private _addToolItem = _logic getVariable ["AddToolItem", false];
if (!(_addToolItem isEqualType false)) then {_addToolItem = false};
if !(_addToolItem isEqualType false) then {_addToolItem = false};
private _objects = [_preset] call FUNC(getPlaceableSet);

View File

@ -65,7 +65,7 @@ if (_zIndex < 5) then {
while {count _nlos != count _excludes && {_c < (count _nlos)}} do {
scopeName "mainSearch";
{
if (!(_forEachIndex in _excludes)) then {
if !(_forEachIndex in _excludes) then {
private _index = _buckets pushBack [_x, [_x]];
_excludes pushBack _forEachIndex;
_bucketPos = _x;
@ -74,7 +74,7 @@ if (_zIndex < 5) then {
};
} forEach _nlos;
{
if (!(_forEachIndex in _excludes)) then {
if !(_forEachIndex in _excludes) then {
_testPos = _x;
if (_testPos vectorDistanceSqr _bucketPos <= 30) then {
_bucketList pushBack _x;

View File

@ -127,7 +127,7 @@ if (_objects isNotEqualTo []) then {
if (_currentCount < 10) then {
private _count = ceil (random (sqrt (_m / 1000)));
private _vecVar = FRAG_VEC_VAR;
if (!(_target isKindOf "Man")) then {
if !(_target isKindOf "Man") then {
ADD(_vecVar,(sqrt _cubic) / 2000);
if ((crew _target) isEqualTo [] && {_count > 0}) then {
_count = 0 max (_count / 2);

View File

@ -34,7 +34,7 @@ while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}}
if (!isNil "_object") then {
private _args = GVAR(arguments) select GVAR(lastIterationIndex);
if (!(_args call FUNC(pfhRound))) then {
if !(_args call FUNC(pfhRound)) then {
_gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false
};
};

View File

@ -22,6 +22,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {false};
// Don't change mode or show hint if advanced throwing is active
if (ACE_player getVariable [QEGVAR(advanced_throwing,inHand), false]) exitWith {false};

View File

@ -46,7 +46,7 @@ if ((getNumber (configOf _vehicle >> QGVAR(addLaserDesignator))) == 1) then {
params ["_vehicle", "_turretPath"];
TRACE_3("checking for laser",_vehicle,_turretPath,_vehicle turretLocal _turretPath);
if (!alive _vehicle) exitWith {};
if (!(_vehicle turretLocal _turretPath)) then {WARNING("Turret not local");};
if !(_vehicle turretLocal _turretPath) then {WARNING("Turret not local");};
private _hasLaser = false;
{
// Most addons just use "Laserdesignator_mounted", but this should cover custom ones

View File

@ -116,7 +116,7 @@ GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (
//Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice)
if (GVAR(openedMenuType) == 0) then {
if (isNull curatorCamera) then {
if (!(isNull (ACE_controlledUAV select 0))) then {
if !(isNull (ACE_controlledUAV select 0)) then {
GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]];
GVAR(expanded) = true;
GVAR(expandedTime) = diag_tickTime;

View File

@ -123,7 +123,7 @@ GVAR(collectedActionPoints) resize 0;
// Render nearby actions, unit self actions or vehicle self actions as appropiate
if (GVAR(openedMenuType) == 0) then {
if (isNull curatorCamera) then {
if (!(isNull (ACE_controlledUAV select 0))) then {
if !(isNull (ACE_controlledUAV select 0)) then {
// Render UAV self actions when in control of UAV AI
(ACE_controlledUAV select 0) call _fnc_renderSelfActions;
} else {

View File

@ -19,6 +19,7 @@
if ((getText (missionconfigfile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith {
TRACE_1("no mission debriefing config",_this);
};
if !(GETEGVAR(medical,enabled,false)) exitWith {
WARNING("No ACE-Medical");
XGVAR(outputText) = "No ACE-Medical";
@ -64,7 +65,7 @@ GVAR(killCount) = 0;
private _killInfo = [];
if (!isNull _killer) then {
if (!(_killer isKindof "CAManBase")) then { // If killer is a vehicle log the vehicle type
if !(_killer isKindof "CAManBase") then { // If killer is a vehicle log the vehicle type
_killInfo pushBack format [LLSTRING(Vehicle), getText ((configOf _killer) >> "displayName")];
};
if (isNull _instigator) then {
@ -77,7 +78,7 @@ GVAR(killCount) = 0;
TRACE_2("",_unitIsPlayer,_instigatorIsPlayer);
// Don't do anything if neither are players
if (!(_unitIsPlayer || _instigatorIsPlayer)) exitWith {};
if !(_unitIsPlayer || _instigatorIsPlayer) exitWith {};
// Log firendly fire
private _fnc_getSideFromConfig = {
@ -89,7 +90,7 @@ GVAR(killCount) = 0;
default {civilian};
};
};
if ((!isNull _instigator) && {_unit != _instigator} && {_instigator isKindOf "CAManBase"}) then {
if (!isNull _instigator && {_unit != _instigator} && {_instigator isKindOf "CAManBase"}) then {
// Because of unconscious group switching/captives it's probably best to just use unit's config side
private _unitSide = [_unit] call _fnc_getSideFromConfig;
private _killerSide = [_instigator] call _fnc_getSideFromConfig;

View File

@ -115,7 +115,7 @@ if (_spots isNotEqualTo []) then {
while { count(_spots) != count(_excludes) && _c < (count _spots) } do {
scopeName "mainSearch";
{
if (!(_forEachIndex in _excludes)) then {
if !(_forEachIndex in _excludes) then {
private _index = _buckets pushBack [_x, [_x]];
_excludes pushBack _forEachIndex;
_bucketPos = _x select 0;
@ -124,7 +124,7 @@ if (_spots isNotEqualTo []) then {
};
} forEach _spots;
{
if (!(_forEachIndex in _excludes)) then {
if !(_forEachIndex in _excludes) then {
private _testPos = (_x select 0);
if ((_testPos vectorDistanceSqr _bucketPos) <= 100) then {
_bucketList pushBack _x;

View File

@ -17,7 +17,7 @@
*/
params ["_caller", "_target"];
if (!(_this call FUNC(canRefuelUAV))) exitWith {};
if !(_this call FUNC(canRefuelUAV)) exitWith {};
private _onFinish = {
(_this select 0) params ["_caller", "_target"];

View File

@ -25,7 +25,7 @@ _args params ["_magazineClassname", "_lastAmmoCount"];
private _fullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count");
// Don't show anything if player can't interact
if (!([ACE_player, objNull, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,canInteractWith))) exitWith {};
if !([ACE_player, objNull, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {};
// Count mags
private _fullMags = 0;

View File

@ -25,7 +25,7 @@ TRACE_3("params",_group,_leadColor,_unitColor);
if (_group isEqualType grpNull) then {_group = groupID _group};
if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")};
if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")};
if (!([_unitColor] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")};
if !([_leadColor] call FUNC(isValidColorArray)) exitWith {ERROR("leadColor is not a valid color array.")};
if !([_unitColor] call FUNC(isValidColorArray)) exitWith {ERROR("color is not a valid color array.")};
GVAR(GroupColorCfgMappingNew) set [toLower _group, [_leadColor, _unitColor]];

View File

@ -20,7 +20,7 @@ scopeName "main";
params ["_colorArray"];
if (isNil "_colorArray") exitWith {false};
if (!(_colorArray isEqualType [])) exitWith {false};
if !(_colorArray isEqualType []) exitWith {false};
if (count _colorArray != 4) exitWith {false};
{

View File

@ -24,9 +24,10 @@ if (!_activated) exitWith {};
// Transcode string setting into usable array. Example: "1,1,1,1" -> [1, 1, 1, 1]
private _leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]");
if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")};
if !([_leadColor] call FUNC(isValidColorArray)) exitWith {ERROR("leadColor is not a valid color array.")};
private _color = call compile ("[" + (_logic getVariable ["color", ""]) + "]");
if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")};
if !([_color] call FUNC(isValidColorArray)) exitWith {ERROR("color is not a valid color array.")};
// Add all synchronized groups and reference custom configuration for them
{

View File

@ -29,14 +29,14 @@ if (!_activated) exitWith {};
private _defaultLeadColor = _logic getVariable ["defaultLeadColor", ""];
if (_defaultLeadColor != "") then {
_defaultLeadColor = call compile ("[" + _defaultLeadColor + "]");
if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
if !([_defaultLeadColor] call FUNC(isValidColorArray)) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
["CBA_settings_setSettingMission", [QGVAR(defaultLeadColor), _defaultLeadColor, true]] call CBA_fnc_localEvent;
};
private _defaultColor = _logic getVariable ["defaultColor", ""];
if (_defaultColor != "") then {
_defaultColor = call compile ("[" + _defaultColor + "]");
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
if !([_defaultColor] call FUNC(isValidColorArray)) exitWith {ERROR("defaultColor is not a valid color array.")};
["CBA_settings_setSettingMission", [QGVAR(defaultColor), _defaultColor, true]] call CBA_fnc_localEvent;
};

View File

@ -43,8 +43,8 @@ private _index = 1;
private _keepCheckingDigits = true;
private _validTimestamp = true;
while {_keepCheckingDigits} do {
if (!(_string select [_index, 1] in DIGITS)) exitWith { _validTimestamp = false; };
if (!(_string select [_index+1, 1] in DIGITS)) exitWith { _validTimestamp = false; };
if !(_string select [_index, 1] in DIGITS) exitWith { _validTimestamp = false; };
if !(_string select [_index+1, 1] in DIGITS) exitWith { _validTimestamp = false; };
switch (_string select [_index+2, 1]) do {
case (":"): {
_index = _index + 3;
@ -54,7 +54,7 @@ while {_keepCheckingDigits} do {
};
case (" "): {
_keepCheckingDigits = false;
if (!(_string select [_index+3, 3] in ["am]", "pm]"])) then {_validTimestamp = false; };
if !(_string select [_index+3, 3] in ["am]", "pm]"]) then {_validTimestamp = false; };
};
default {
_keepCheckingDigits = false;

View File

@ -10,10 +10,10 @@ GVAR(dev_watchVariableRunning) = true;
if (!isNull _display) exitWith {"Paused"};
private _unit = cursorTarget;
if (!(_unit isKindOf "CAManBase")) then {_unit = cursorObject};
if (!(_unit isKindOf "CAManBase")) then {_unit = ACE_player};
if !(_unit isKindOf "CAManBase") then {_unit = cursorObject};
if !(_unit isKindOf "CAManBase") then {_unit = ACE_player};
if ((_unit != ACE_player) && {IS_UNCONSCIOUS(ACE_player)}) then {_unit = ACE_player};
if (!(_unit isKindOf "CAManBase")) exitWith {"No Unit?"};
if !(_unit isKindOf "CAManBase") exitWith {"No Unit?"};
private _return = [];

View File

@ -21,7 +21,7 @@ GVAR(selfInteractionActions) = [];
[QEGVAR(interact_menu,newControllableObject), {
params ["_type"]; // string of the object's classname
if (!(_type isKindOf "CAManBase")) exitWith {};
if !(_type isKindOf "CAManBase") exitWith {};
{
_x set [0, _type];
_x call EFUNC(interact_menu,addActionToClass);

View File

@ -21,7 +21,7 @@ params ["_medic", "_patient", "_bodyPart"];
private _heartRate = 0;
if (!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then {
if !([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo)) then {
_heartRate = switch (true) do {
case (alive _patient): {
GET_HEART_RATE(_patient)

View File

@ -77,12 +77,12 @@ _patient setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
// wakeup needs to be done after achieving stable vitals, but before manually reseting unconc var
if IS_UNCONSCIOUS(_patient) then {
if (!([_patient] call EFUNC(medical_status,hasStableVitals))) then { ERROR_2("fullheal [unit %1][state %2] did not restore stable vitals",_patient,_state); };
if !([_patient] call EFUNC(medical_status,hasStableVitals)) then {ERROR_2("fullheal [unit %1][state %2] did not restore stable vitals",_patient,_state);};
TRACE_1("Waking up",_patient);
[QEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent;
_state = GET_SM_STATE(_patient);
TRACE_1("after WakeUp",_state);
if IS_UNCONSCIOUS(_patient) then { ERROR_2("fullheal [unit %1][state %2] failed to wake up patient",_patient,_state); };
if IS_UNCONSCIOUS(_patient) then {ERROR_2("fullheal [unit %1][state %2] failed to wake up patient",_patient,_state);};
};
// Generic medical admin

View File

@ -18,7 +18,7 @@
TRACE_1("cycle fire mode",_this);
if (!alive ACE_player) exitWith {};
if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {};
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {};
private _currentShooter = objNull;

View File

@ -20,7 +20,7 @@
params ["_shooter","_weapon","","_mode","_ammo","","_projectile"];
// Bail on not missile
if (!(_ammo isKindOf "MissileBase")) exitWith {};
if !(_ammo isKindOf "MissileBase") exitWith {};
// Bail if guidance is disabled for this ammo
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {};

View File

@ -28,7 +28,7 @@ if (_vehicle distance ACE_player > 8000) exitWith {};
//AI will have no clue how to use:
private _shooterMan = gunner _vehicle;
if (!([_shooterMan] call EFUNC(common,isPlayer))) exitWith {};
if !([_shooterMan] call EFUNC(common,isPlayer)) exitWith {};
//Calculate air density:
private _altitude = (getPosASL _vehicle) select 2;

View File

@ -19,7 +19,7 @@
params ["_player", "_newVehicle"];
if (isNull _newVehicle) exitWith {};
if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
if !(_newVehicle isKindOf "Mortar_01_base_F") exitWith {};
private _tubeWeaponName = (weapons _newVehicle) select 0;
private _fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes");

View File

@ -61,7 +61,7 @@ if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If v
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((currentVisionMode ACE_player != 1)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting)
if !(missionNamespace getVariable [QGVAR(allowBrightnessControl), true]) exitWith {false}; // just a mission setVar (not ace_setting)
// Statement
[ACE_player, 1] call FUNC(changeNVGBrightness);
@ -73,7 +73,7 @@ if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If v
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((currentVisionMode ACE_player != 1)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting)
if !(missionNamespace getVariable [QGVAR(allowBrightnessControl), true]) exitWith {false}; // just a mission setVar (not ace_setting)
// Statement
[ACE_player, -1] call FUNC(changeNVGBrightness);

View File

@ -19,8 +19,8 @@
TRACE_1("lock key down",GVAR(isLockKeyDown));
if (!alive ACE_player) exitWith {};
if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {};
if (!(ACE_player call CBA_fnc_canUseWeapon)) exitWith {};
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {};
if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {};
if ((getNumber (configFile >> "CfgWeapons" >> (currentWeapon ACE_player) >> QGVAR(enabled))) == 0) exitWith {};
if (GVAR(isLockKeyDown)) exitWith {ERROR("already running?");};

View File

@ -4,6 +4,6 @@
// Test binarization one time at startup - ref https://github.com/acemod/ACE3/pull/8093
private _test = getText (configFile >> "Cfg3DEN" >> "Object" >> "AttributeCategories" >> "ace_attributes" >> "Attributes" >> "ace_rearm_rearmCargo" >> "defaultValue");
if (!("else {" in _test)) then {
if !("else {" in _test) then {
ERROR("3den attribute has ERROR [check binarization]");
};

View File

@ -29,7 +29,7 @@ addMissionEventHandler ["Draw3D", {
_info = _info + "[Wheel]";
_color = [0,1,0,1];
};
if (!((getText (_config>> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"])) then {
if !((getText (_config>> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"]) then {
_info = _info + format ["[depends: %1]", getText (_config>> "HitPoints" >> _hitpoint >> "depends")];
_color = [0,0,1,1]
};

View File

@ -65,7 +65,7 @@ if (!_return) exitWith {false};
// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false};
private _repairLocations = getArray (_config >> "repairLocations");
if (!("All" in _repairLocations)) then {
if !("All" in _repairLocations) then {
private _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))};
private _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))};
{

View File

@ -117,7 +117,7 @@ private _processedSelections = [];
continue
};
if (!(getText (_vehCfg >> "HitPoints" >> _hitpoint >> "depends") in ["", "0"])) then { // skip depends hitpoints, should be normalized by engine
if !(getText (_vehCfg >> "HitPoints" >> _hitpoint >> "depends") in ["", "0"]) then { // skip depends hitpoints, should be normalized by engine
TRACE_3("Skipping depends hitpoint",_hitpoint,_forEachIndex,_selection);
/*#ifdef DEBUG_MODE_FULL
systemChat format ["Skipping depends hitpoint, hitpoint %1, index %2, selection %3", _hitpoint, _forEachIndex, _selection];

View File

@ -33,7 +33,7 @@ private _dependentHitPointScripts = [];
{
if ((_x != "") && {isClass (_config >> _x)} && {!(_x in _realHitPoints)}) then {
_realHitPoints pushBack _x;
if (!((getText (_config >> _x >> "depends")) in ["", "0"])) then {
if !((getText (_config >> _x >> "depends")) in ["", "0"]) then {
_dependentHitPoints pushBack _x;
_dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends");
};

View File

@ -70,7 +70,7 @@ if (!_return) exitWith {false};
// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false};
private _repairLocations = getArray (_config >> "repairLocations");
if (!("All" in _repairLocations)) then {
if !("All" in _repairLocations) then {
private _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))};
private _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))};
{

View File

@ -65,7 +65,7 @@ if (isNil _callback) then {
} else {
_callback = missionNamespace getVariable _callback;
};
if (!(_callback isEqualType {})) then {_callback = {TRACE_1("callback was NOT code",_callback)};};
if !(_callback isEqualType {}) then {_callback = {TRACE_1("callback was NOT code",_callback)};};
_args call _callback;

View File

@ -60,7 +60,7 @@ if (isNil _callback) then {
} else {
_callback = missionNamespace getVariable _callback;
};
if (!(_callback isEqualType {})) then {_callback = {TRACE_1("callback was NOT code",_callback)};};
if !(_callback isEqualType {}) then {_callback = {TRACE_1("callback was NOT code",_callback)};};
_args call _callback;

View File

@ -22,7 +22,7 @@ if (!GVAR(enabled)) exitWith {false};
params ["_unit", "_turretAndDirection", "_majorStep"];
TRACE_3("adjustScope",_unit,_turretAndDirection,_majorStep);
if (!(_unit isKindOf "Man")) exitWith {false};
if !(_unit isKindOf "Man") exitWith {false};
if (currentMuzzle _unit != currentWeapon _unit) exitWith {false};
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);

View File

@ -20,7 +20,7 @@ params ["_unit"];
if (cameraView == "GUNNER") exitWith {false};
if (!isNull objectParent _unit) exitWith {false};
if (GVAR(simplifiedZeroing)) exitWith {false};
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false};
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {false};

View File

@ -19,7 +19,7 @@ params ["_unit"];
if (cameraView == "GUNNER") exitWith {false};
if (!isNull objectParent _unit) exitWith {false};
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false};
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {false};

View File

@ -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);
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if !(_ammo isKindOf "BulletBase") exitWith {};
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {};

View File

@ -17,12 +17,12 @@
params ["_unit"];
if (!GVAR(enabled)) exitWith { currentZeroing _unit };
if (!GVAR(enabled)) exitWith {currentZeroing _unit};
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith { currentZeroing _unit };
if (GVAR(simplifiedZeroing)) exitWith {
if (!(GVAR(canAdjustElevation) select _weaponIndex)) exitWith { currentZeroing _unit };
if !(GVAR(canAdjustElevation) select _weaponIndex) exitWith {currentZeroing _unit};
private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]];
((_adjustment select _weaponIndex) select 0)
};

View File

@ -21,7 +21,7 @@ params ["_unit"];
private _optics = ["", "", ""];
if (!(_unit isKindOf "CAManBase")) exitWith {_optics};
if !(_unit isKindOf "CAManBase") exitWith {_optics};
{
if (count _x >= 2) then {

View File

@ -2,7 +2,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -14,7 +14,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -26,7 +26,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -38,7 +38,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -50,7 +50,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -62,7 +62,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -74,7 +74,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);
@ -86,7 +86,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};
[ACE_player] call FUNC(inventoryCheck);

View File

@ -78,7 +78,7 @@ if (_seatsClaimed isEqualTo []) then {
_seat setVariable [QGVAR(seatsClaimed), _seatsClaimed, true];
// Also prevent dragging/carrying
if (!([_seat] call EFUNC(common,owned))) then {
if !([_seat] call EFUNC(common,owned)) then {
[_player, _seat] call EFUNC(common,claim);
};

View File

@ -18,7 +18,7 @@
params ["_unit"];
// don't switch to original player units
if (!([_unit] call FUNC(isValidAi))) exitWith {};
if !([_unit] call FUNC(isValidAi)) exitWith {};
// exit var
private _leave = false;

View File

@ -29,10 +29,10 @@ params [
["_dimension", 512, [0]]
];
if (_textColor select [0, 1] == "#") then { _textColor = _textColor select [1]; };
if (_backgroundColor select [0, 1] == "#") then { _backgroundColor = _backgroundColor select [1]; };
if (!((count _textColor) in [6,8])) exitWith { ERROR_1("bad Tcolor %1",_textColor); "" };
if (!((count _backgroundColor) in [6,8])) exitWith { ERROR_1("bad Bcolor %1",_textColor); "" };
if (_textColor select [0, 1] == "#") then {_textColor = _textColor select [1];};
if (_backgroundColor select [0, 1] == "#") then {_backgroundColor = _backgroundColor select [1];};
if !((count _textColor) in [6,8]) exitWith {ERROR_1("bad Tcolor %1",_textColor); ""};
if !((count _backgroundColor) in [6,8]) exitWith {ERROR_1("bad Bcolor %1",_textColor); ""};
if (_autoMultiline) then {
private _magicWidth = 0.75;

View File

@ -29,7 +29,7 @@ TRACE_2("",_vehicle,_text);
if (!isServer) exitWith {};
if (_text == "") exitWith {};
private _clanSel = getText (configOf _vehicle >> "selectionClan");
if (!(_clanSel in selectionNames _vehicle)) exitWith { TRACE_1("no tag",_clanSel); };
if !(_clanSel in selectionNames _vehicle) exitWith {TRACE_1("no tag",_clanSel);};
private _texture = [_text, _textSize, _textColor, "00000000", true] call FUNC(generateStencilTexture);
TRACE_1("",_texture);

View File

@ -16,7 +16,7 @@
* Public: No
*/
if (!((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"])) exitWith {
if !((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
GVAR(currentMode) = "";

View File

@ -10,7 +10,7 @@
TRACE_3("bailOut",_center,_crewman,_vehicle);
if (isPlayer _crewman) exitWith {};
if (!alive _crewman || { !( [_crewman] call EFUNC(common,isAwake))} ) exitWith {};
if (!alive _crewman || {!([_crewman] call EFUNC(common,isAwake))}) exitWith {};
unassignVehicle _crewman;
_crewman leaveVehicle _vehicle;

View File

@ -23,8 +23,12 @@ if (!params [["_unit", objNull, [objNull]], ["_veh", objNull, [objNull]], ["_use
};
TRACE_3("params",_unit,_veh,_useCustom);
if (isNull _unit) exitWith {ERROR("null unit");};
if (isNull _veh) exitWith {ERROR("null vehicle");};
if (isNull _unit) exitWith {
ERROR("null unit");
};
if (isNull _veh) exitWith {
ERROR("null vehicle");
};
if (_useCustom) then {
private _previousMags = magazinesDetail _unit;

View File

@ -33,7 +33,10 @@ if ((locked _veh) == 0) exitWith {false};
if !("ACE_key_lockpick" in (_unit call EFUNC(common,uniqueItems))) exitWith {false};
private _vehLockpickStrength = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)];
if (!(_vehLockpickStrength isEqualType 0)) exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false};
if !(_vehLockpickStrength isEqualType 0) exitWith {
ERROR("ACE_vehicleLock_LockpickStrength invalid");
false
};
//-1 indicates unpickable lock
if (_vehLockpickStrength < 0) exitWith {false};
@ -45,7 +48,7 @@ private _condition = {
((_unit distance _veh) < 5) && {(speed _veh) < 0.1}
};
if (!([[_unit, _veh]] call _condition)) exitWith {false};
if !([[_unit, _veh]] call _condition) exitWith {false};
private _returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"];
switch (_funcType) do {

View File

@ -22,7 +22,7 @@ if (!isServer) exitWith {};
params ["_logic", "_syncedObjects", "_activated"];
TRACE_3("params",_logic,_syncedObjects,_activated);
if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");};
if (!_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");};
[{
params ["_syncedObjects"];

View File

@ -27,7 +27,7 @@ private _newIndex = -1;
if (cba_events_control) then {
if (cameraView != "INTERNAL") exitWith {};
if (isTurnedOut _player) exitWith {};
if (!([_player, _vehicle, []] call EFUNC(common,canInteractWith))) exitWith {};
if !([_player, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {};
BEGIN_COUNTER(newIndex);
if ((_shownIndex > -1) && {currentVisionMode _player != _lastVisionMode}) then {

View File

@ -41,6 +41,6 @@ private _compartment = switch (_role) do {
};
};
if (!(_compartment isEqualType "")) then { _compartment = format ["Compartment%1",_compartment] };
if !(_compartment isEqualType "") then {_compartment = format ["Compartment%1",_compartment]};
[_role, _cargoIndex, _turretPath, _compartment]

View File

@ -18,7 +18,7 @@
params ["_newCameraView", "_cameraOn"];
if (! ([_newCameraView, _cameraOn] call FUNC(canChangeCamera))) exitWith {};
if !([_newCameraView, _cameraOn] call FUNC(canChangeCamera)) exitWith {};
TRACE_1("View Restricted",XGVAR(mode));

View File

@ -198,7 +198,7 @@ if (!hasInterface) exitWith {};
["ACE3 Vehicles", QGVAR(CollisionLights), localize LSTRING(CollisionLights), {
// Conditions: canInteract
if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false};
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((ACE_player isEqualTo (vehicle ACE_player)) || {ACE_player != (driver (vehicle ACE_player))}) exitWith {false};

View File

@ -47,15 +47,15 @@ if (_terrainEffectEnabled) then {
private _newWindSpeed = 0;
{
private _windSource = [100, _windDirAdjusted, _x] call _fnc_polar2vect;
if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith {
if !(terrainIntersectASL [_position, _position vectorAdd _windSource]) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
_windSource = [100, _windDirAdjusted + _x, 0] call _fnc_polar2vect;
if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith {
if !(terrainIntersectASL [_position, _position vectorAdd _windSource]) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
_windSource = [100, _windDirAdjusted - _x, 0] call _fnc_polar2vect;
if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith {
if !(terrainIntersectASL [_position, _position vectorAdd _windSource]) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
} forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
@ -69,15 +69,15 @@ if (_obstacleEffectEnabled) then {
private _newWindSpeed = 0;
{
private _windSource = [20, _windDirAdjusted, _x] call _fnc_polar2vect;
if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith {
if !(lineIntersects [_position, _position vectorAdd _windSource]) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
_windSource = [20, _windDirAdjusted + _x, 0] call _fnc_polar2vect;
if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith {
if !(lineIntersects [_position, _position vectorAdd _windSource]) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
_windSource = [20, _windDirAdjusted - _x, 0] call _fnc_polar2vect;
if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith {
if !(lineIntersects [_position, _position vectorAdd _windSource]) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
} forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45];

View File

@ -19,8 +19,8 @@
params ["_func", "_keyDown"];
if (!GVAR(shown)) exitWith { false }; // fast exit if not shown
if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith { false };
if (!(ACE_player call CBA_fnc_canUseWeapon)) exitWith { false };
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith { false };
if !(ACE_player call CBA_fnc_canUseWeapon) exitWith { false };
if (currentMuzzle ACE_player != currentWeapon ACE_player) exitWith { false };
private _display = uinamespace getVariable [QGVAR(display), displayNull];

View File

@ -17,7 +17,7 @@
params ["_object"];
if (!(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {};
if !(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)]) exitWith {};
[{
TRACE_1("Delayed addCuratorEditableObjects",_this);

View File

@ -23,13 +23,13 @@ params ["_logic", "_units", "_activated"];
if (_activated) then {
//--- Terminate when not created on the server
if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith {
// Terminate when not created on the server
if (!isServer && local _logic && isnull (getassignedcuratorunit _logic)) exitwith {
[format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp;
deletevehicle _logic;
};
//--- Get curator owner
// Get curator owner
_ownerVar = _logic getvariable ["owner",""];
_ownerUID = parsenumber _ownerVar;
if (cheatsenabled) then {
@ -46,13 +46,13 @@ if (_activated) then {
};
_isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted";
//--- Wipe out the variable so clients can't access it
// Wipe out the variable so clients can't access it
_logic setvariable ["owner",nil];
//--- Server
// Server
if (isserver) then {
//--- Prepare admin variable
// Prepare admin variable
_adminVar = "";
if (_isAdmin) then {
_letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
@ -61,12 +61,12 @@ if (_activated) then {
_logic setvariable ["adminVar",_adminVar,true];
};
//--- Get allowed addons
// Get allowed addons
_addonsType = _logic getvariable ["Addons",2];
_addons = [];
switch _addonsType do {
//--- All (including unofficial ones)
// All (including unofficial ones)
case 3: {
_cfgPatches = configfile >> "cfgpatches";
for "_i" from 0 to (count _cfgPatches - 1) do {
@ -79,10 +79,10 @@ if (_activated) then {
_logic addcuratoraddons _addons;
};
//--- All active
// All active
case 2: {};
//--- All mission
// All mission
case 1: {
_addonsList = [];
{
@ -92,13 +92,13 @@ if (_activated) then {
_logic addcuratoraddons _addonsList;
};
//--- None
// None
case 0: {
removeallcuratoraddons _logic;
};
};
//--- Handle ownership
// Handle ownership
[_logic,_ownerVar,_ownerUID,_adminVar] spawn {
scriptname "BIS_fnc_moduleCurator: Owner";
@ -110,16 +110,16 @@ if (_activated) then {
_name = _logic getvariable ["name",""];
if (_name == "") then {_name = localize "STR_A3_curator";};
//--- Wait until mission starts
// Wait until mission starts
waitUntil {time > 0}; // NOTE: DO NOT CHANGE TO CBA_missionTime, IT BREAKS THE MODULE
//--- Refresh addon list, so it's broadcasted to clients
// Refresh addon list, so it's broadcasted to clients
_addons = curatoraddons _logic;
removeAllCuratorAddons _logic;
_logic addcuratoraddons _addons;
while {true} do {
//--- Wait for player to become Zeus
// Wait for player to become Zeus
switch true do {
case (_ownerUID > 0): {
waituntil {
@ -133,7 +133,7 @@ if (_activated) then {
};
if (isnull _logic) exitwith {};
//--- Assign
// Assign
_player = objnull;
switch true do {
case (_ownerUID > 0): {
@ -150,7 +150,7 @@ if (_activated) then {
waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic};
if (isnull _logic) exitwith {};
//--- Add radio channels
// Add radio channels
{
_x radiochanneladd [_player];
} foreach (_logic getvariable ["channels",[]]);
@ -159,7 +159,7 @@ if (_activated) then {
private _msgCode = {
params ["_logic","_player"];
//--- Sent notification to all assigned players
// Sent notification to all assigned players
if ((_logic getVariable ["showNotification",true]) && GVAR(zeusAscension)) then {
{
if (isplayer _x) then {
@ -181,7 +181,7 @@ if (_activated) then {
// Added by ace_zeus
[QGVAR(zeusUnitAssigned), [_logic,_player]] call CBA_fnc_globalEvent;
//--- Wait for player to stop being Zeus
// Wait for player to stop being Zeus
switch true do {
case (_ownerUID > 0): {
waituntil {
@ -195,12 +195,12 @@ if (_activated) then {
};
if (isnull _logic) exitwith {};
//--- Add radio channels
// Add radio channels
{
_x radiochannelremove [_player];
} foreach (_logic getvariable ["channels",[]]);
//--- Unassign
// Unassign
waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic};
if (isnull _logic) exitwith {};
};
@ -211,14 +211,14 @@ if (_activated) then {
params ["_logic"];
if (GVAR(zeusBird)) then {
//--- Create bird
// Create bird
_birdType = _logic getVariable ["birdType","eagle_f"];
if (_birdType != "") then {
_bird = createvehicle [_birdType,[100,100,100],[],0,"none"];
_logic setVariable ["bird",_bird,true];
};
//--- Locality changed
// Locality changed
_logic addeventhandler [
"local",
{
@ -237,7 +237,7 @@ if (_activated) then {
[_logic] call _birdCode;
};
//--- Activated all future addons
// Activated all future addons
_addons = [];
{
if (typeof _x == "ModuleCuratorAddAddons_F") then {
@ -254,12 +254,12 @@ if (_activated) then {
if (time <= 0) then { _addons call bis_fnc_activateaddons; };
};
//--- Player
// Player
if (hasinterface) then {
waituntil {local player};
_serverCommand = ["#kick", "#shutdown"] select (_ownerVar == "#adminLogged");
//--- Black effect until the interface is open
// Black effect until the interface is open
_forced = _logic getvariable ["forced",0] > 0;
if (_forced) then {
_isCurator = switch true do {
@ -279,15 +279,15 @@ if (_activated) then {
};
};
//--- Check if player is server admin
// Check if player is server admin
if (_isAdmin) then {
_adminVar = _logic getvariable ["adminVar",""];
_logic setvariable ["adminVar",nil];
if (isserver) then {
//--- Host
// Host
missionnamespace setvariable [_adminVar,player];
} else {
//--- Client
// Client
[_logic,_adminVar,_serverCommand] spawn {
scriptname "BIS_fnc_moduleCurator: Admin check";
@ -314,7 +314,7 @@ if (_activated) then {
sleep 1;
waituntil {alive player};
//--- Show warning when Zeus key is not assigned
// Show warning when Zeus key is not assigned
if (count (actionkeys "curatorInterface") == 0) then {
[
format [
@ -324,7 +324,7 @@ if (_activated) then {
] call bis_fnc_guiMessage;
};
//--- Show hint about pinging for players
// Show hint about pinging for players
if (
isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"}
&&
@ -339,7 +339,7 @@ if (_activated) then {
};
};
//--- Add local event handlers
// Add local event handlers
_logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}];
_logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}];
_logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}];

View File

@ -30,13 +30,13 @@ TRACE_4("moduleCargoParadrop placed",_logic,typeOf _vehicle,_pilot,typeOf _pilot
deleteVehicle _logic; // cleanup logic now, we just needed it to get the attached vehicle
if (!(missionNamespace getVariable [QEGVAR(cargo,enable), false])) exitWith {
if !(missionNamespace getVariable [QEGVAR(cargo,enable), false]) exitWith {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
};
if (isNull _vehicle) exitWith {
[LSTRING(NothingSelected)] call FUNC(showMessage);
};
if (!(_vehicle isKindOf "Air")) exitWith {
if !(_vehicle isKindOf "Air") exitWith {
[format ["%1 %2", localize "str_dn_aircraft", localize "str_msg_no_veh_select"]] call FUNC(showMessage);
};
if ((!alive _vehicle) || {!alive _pilot}) exitWith {

View File

@ -22,7 +22,7 @@ TRACE_2("moduleCargoParadropWaypoint",_vehicleGroup,_wpPos);
private _vehicle = vehicle leader _vehicleGroup;
private _commander = driver _vehicle;
private _cargo = _vehicle getVariable [QEGVAR(cargo,loaded), []];
if (!(_vehicle isKindOf "Air")) exitWith {WARNING_1("not in a air vehicle",typeOf _vehicle); true};
if !(_vehicle isKindOf "Air") exitWith {WARNING_1("not in a air vehicle",typeOf _vehicle); true};
if (_cargo isEqualTo []) exitWith {WARNING_1("no cargo",_cargo); true};
private _previousSpeedMode = speedMode _vehicleGroup;

View File

@ -40,7 +40,7 @@ if !(GETEGVAR(medical,enabled,false)) then {
if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then {
[LSTRING(OnlyNonCaptive)] call FUNC(showMessage);
} else {
if (!(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false))) then {
if !(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false)) then {
_unit setVariable [QEGVAR(medical,isMedicalFacility), true, true];
};
};

View File

@ -57,7 +57,7 @@ if (_autoSeek) then {
LOG("Unit deleted or killed, PFH removed");
};
if (!([_unit] call EFUNC(common,isAwake))) exitWith {};
if !([_unit] call EFUNC(common,isAwake)) exitWith {};
// Detonation
private _nearObjects = (_unit nearObjects _activationRadius) select {side _x == _activationSide && {_x != _unit} && {alive _x}};

View File

@ -18,7 +18,7 @@
* Public: Yes
*/
if (!(_this isEqualTypeParams [""])) exitWith {ERROR_1("First arg must be string [%1]",_this);};
if !(_this isEqualTypeParams [""]) exitWith {ERROR_1("First arg must be string [%1]",_this);};
private _message = _this apply {if ((_x isEqualType "") && {isLocalized _x}) then {localize _x} else {_x}};
[objNull, format _message] call BIS_fnc_showCuratorFeedbackMessage;