diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index eac28147c00..b8aeda905d0 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -3,3 +3,8 @@ options.ignore = [ "addPublicVariableEventHandler", # Alt syntax is broken, we are using main syntax "createSoundSource", # Greatly attenuated when in first person and in a vehicle ] + +[sqf.var_all_caps] +options.ignore = [ + "SLX_*", "ACE_*" +] diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index a426f6ba99a..f48715a5d36 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -26,7 +26,7 @@ if (GVAR(Protractor)) exitWith { true }; if (weaponLowered ACE_player) exitWith { false }; -if (vehicle ACE_player != ACE_player) exitWith { false }; +if (!isNull objectParent ACE_player) exitWith { false }; if (currentWeapon ACE_player != primaryWeapon ACE_player) exitWith { false }; 2 cutText ["", "PLAIN"]; diff --git a/addons/advanced_throwing/XEH_postInit.sqf b/addons/advanced_throwing/XEH_postInit.sqf index d91129b0250..dd7a3f12806 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -77,7 +77,7 @@ GVAR(tempWindInfo) = false; } else { params ["_interactionType"]; // Ignore self-interaction menu, when in vehicle and when pick up is disabled - if (GVAR(enablePickUp) && {_interactionType == 0} && {vehicle ACE_player == ACE_player}) then { + if (GVAR(enablePickUp) && {_interactionType == 0} && {isNull objectParent ACE_player}) then { // Show pick up actions on CfgAmmo's call FUNC(renderPickUpInteraction); }; diff --git a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf index f85c33dbde2..8623443d036 100644 --- a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf +++ b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf @@ -109,7 +109,7 @@ private _posHeadRel = ACE_player selectionPosition "head"; private _leanCoef = (_posHeadRel select 0) - 0.15; // 0.15 counters the base offset // Don't take leaning into account when weapon is lowered due to jiggling when walking side-ways (bandaid) -if (abs _leanCoef < 0.15 || {vehicle ACE_player != ACE_player} || {weaponLowered ACE_player}) then { +if (abs _leanCoef < 0.15 || {!isNull objectParent ACE_player} || {weaponLowered ACE_player}) then { _leanCoef = 0; }; @@ -144,7 +144,7 @@ if (ACE_player getVariable [QGVAR(dropMode), false]) then { _posFin = _posFin vectorAdd (AGLToASL (positionCameraToWorld _cameraOffset)); - if (vehicle ACE_player != ACE_player) then { + if (!isNull objectParent ACE_player) then { // Counteract vehicle velocity including acceleration private _vectorDiff = (velocity (vehicle ACE_player)) vectorMultiply (time - (ACE_player getVariable [QGVAR(lastTick), time]) + 0.01); _posFin = _posFin vectorAdd _vectorDiff; diff --git a/addons/advanced_throwing/functions/fnc_onMouseButtonDown.sqf b/addons/advanced_throwing/functions/fnc_onMouseButtonDown.sqf index 9e6f57d9e8d..72ecbb1b721 100644 --- a/addons/advanced_throwing/functions/fnc_onMouseButtonDown.sqf +++ b/addons/advanced_throwing/functions/fnc_onMouseButtonDown.sqf @@ -24,7 +24,7 @@ params ["", "_key"]; if (_key == 0) exitWith { if (!isNull (ACE_player getVariable [QGVAR(activeThrowable), objNull])) then { // Look gets automatically pointed at weapon direction on first LMB press when in FFV seat, require weapon to be up if in vehicle - private _inVehicle = vehicle ACE_player != ACE_player; + private _inVehicle = !isNull objectParent ACE_player; if (!_inVehicle || {_inVehicle && {!weaponLowered ACE_player}}) then { [ACE_player] call FUNC(throw); }; diff --git a/addons/advanced_throwing/functions/fnc_onMouseScroll.sqf b/addons/advanced_throwing/functions/fnc_onMouseScroll.sqf index 290f6ca28e1..94f04000b1e 100644 --- a/addons/advanced_throwing/functions/fnc_onMouseScroll.sqf +++ b/addons/advanced_throwing/functions/fnc_onMouseScroll.sqf @@ -30,7 +30,7 @@ if (ACE_player getVariable [QGVAR(dropMode), false]) then { }; // Limit distance in vehicle - if (vehicle ACE_player != ACE_player) then { + if (!isNull objectParent ACE_player) then { ACE_player setVariable [QGVAR(dropDistance), (ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]) min 0.5]; }; } else { diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index 9b70d35ff4e..2a6044559d7 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -19,7 +19,7 @@ params ["_attachToVehicle", "_unit"]; TRACE_2("params",_attachToVehicle,_unit); -if ((vehicle _unit) != _unit) exitWith {false}; +if (!isNull objectParent _unit) exitWith {false}; private _attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; if ((count _attachedList) == 0) exitWith {false}; diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 204206e5069..c5f87e86d20 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -22,5 +22,5 @@ params ["_unit", "_target"]; (_target getVariable [QGVAR(isHandcuffed), false]) && {isNull (attachedTo _target)} && {_target call EFUNC(common,isAwake)} && -{(vehicle _unit) == _unit} && -{(vehicle _target) == _target} +{isNull objectParent _unit} && +{isNull objectParent _target} diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 46da188238f..59a66b9e628 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -30,7 +30,7 @@ if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { }; } forEach (attachedObjects _unit); }; -if (isNull _target || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false}; +if (isNull _target || {!isNull objectParent _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false}; if (isNull _vehicle) then { // Looking at a captive unit, get nearest vehicle with valid seat: diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index 0ff4ab0f5dc..5cbf66edb73 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -21,4 +21,4 @@ params ["_unit", "_target"]; //Unit is handcuffed and not currently being escorted _target getVariable [QGVAR(isHandcuffed), false] && {isNull (attachedTo _target)} && -{(vehicle _target) == _target} +{isNull objectParent _target} diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 34bc46b1f50..740acc691aa 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -27,7 +27,7 @@ if (isNull _target && {_unit getVariable [QGVAR(isEscorting), false]}) then { }; } forEach (attachedObjects _unit); }; -if (isNull _target || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {WARNING("");}; +if (isNull _target || {!isNull objectParent _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {WARNING("");}; if (isNull _vehicle) then { // Looking at a captive unit, get nearest vehicle with valid seat: diff --git a/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf b/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf index 8ce4391783a..6f2f4f149e8 100644 --- a/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf +++ b/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf @@ -18,7 +18,7 @@ params ["_unit", "_newAnimation"]; TRACE_2("AnimChanged",_unit,_newAnimation); -if (_unit == (vehicle _unit)) then { +if (isNull objectParent _unit) then { if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {_unit call EFUNC(common,isAwake)}) then { TRACE_1("Handcuff animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 2ccd36493c8..53d28cccdb0 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -60,7 +60,7 @@ if (_state) then { params ["_unit"]; if !(_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {}; - if ((vehicle _unit) == _unit) then { + if (isNull objectParent _unit) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); } else { @@ -91,7 +91,7 @@ if (_state) then { _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; - if (((vehicle _unit) == _unit) && {_unit call EFUNC(common,isAwake)}) then { + if ((isNull objectParent _unit) && {_unit call EFUNC(common,isAwake)}) then { //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 3a3724c94d2..22a07ee1c5b 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -39,7 +39,7 @@ if ((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _state) exitWit }; if (_state) then { - if ((vehicle _unit) != _unit) exitWith {WARNING("Cannot surrender while mounted");}; + if (!isNull objectParent _unit) exitWith {WARNING("Cannot surrender while mounted");}; if (_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {WARNING("Cannot surrender while handcuffed");}; _unit setVariable [QGVAR(isSurrendering), true, true]; @@ -57,7 +57,7 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ params ["_unit"]; - if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then { + if (_unit getVariable [QGVAR(isSurrendering), false] && {isNull objectParent _unit}) then { //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; @@ -89,7 +89,7 @@ if (_state) then { if !(_unit call EFUNC(common,isAwake)) exitWith {}; //don't touch animations if unconscious //if we are in "hands up" animationState, crack it now - if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) then { + if ((isNull objectParent _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) then { [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); } else { //spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up" @@ -102,7 +102,7 @@ if (_state) then { [_pfID] call CBA_fnc_removePerFrameHandler; }; //Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition) - if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) exitWith { + if ((isNull objectParent _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 9e85c30dce3..2f0614ef923 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -33,7 +33,7 @@ if (_animation == "") then { TRACE_2("",local _unit,vehicle _unit); switch (_priority) do { case 0: { - if (_unit == vehicle _unit) then { + if (isNull objectParent _unit) then { [QGVAR(playMove), [_unit, _animation], _unit] call CBA_fnc_targetEvent; } else { // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have local effects when executed on remote machines inside vehicles. @@ -41,7 +41,7 @@ switch (_priority) do { }; }; case 1: { - if (_unit == vehicle _unit) then { + if (isNull objectParent _unit) then { [QGVAR(playMoveNow), [_unit, _animation], _unit] call CBA_fnc_targetEvent; } else { // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have local effects when executed on remote machines inside vehicles. @@ -50,7 +50,7 @@ switch (_priority) do { }; case 2: { // try playMoveNow first - if (_unit == vehicle _unit) then { + if (isNull objectParent _unit) then { [QGVAR(playMoveNow), [_unit, _animation], _unit] call CBA_fnc_targetEvent; } else { // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have local effects when executed on remote machines inside vehicles. diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 838f48c89e4..51887842e4d 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -23,7 +23,7 @@ private _anim = animationState _unit; [QGVAR(headbugFixUsed), [profileName, _anim]] call CBA_fnc_serverEvent; [QGVAR(headbugFixUsed), [profileName, _anim]] call CBA_fnc_localEvent; -if (_unit != vehicle _unit || {!([_unit, objNull, ["isNotSitting"]] call FUNC(canInteractWith))}) exitWith {false}; +if (!isNull objectParent _unit || {!([_unit, objNull, ["isNotSitting"]] call FUNC(canInteractWith))}) exitWith {false}; ["ace_headBugFix", true] call FUNC(setDisableUserInputStatus); diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index b7433b92aae..f23fc3ababc 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -198,11 +198,11 @@ GVAR(menuRun) = true; GVAR(vectorConnected) = false; GVAR(displaySelection) = "WP"; switch (GVAR(selection)) do { - case 0: { DAGR_WP_INFO = GVAR(wp0); }; - case 1: { DAGR_WP_INFO = GVAR(wp1); }; - case 2: { DAGR_WP_INFO = GVAR(wp2); }; - case 3: { DAGR_WP_INFO = GVAR(wp3); }; - case 4: { DAGR_WP_INFO = GVAR(wp4); }; + case 0: { GVAR(wp_info) = GVAR(wp0); }; + case 1: { GVAR(wp_info) = GVAR(wp1); }; + case 2: { GVAR(wp_info) = GVAR(wp2); }; + case 3: { GVAR(wp_info) = GVAR(wp3); }; + case 4: { GVAR(wp_info) = GVAR(wp4); }; }; if (!GVAR(busy)) then { GVAR(showInfoUpdating) = true; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index bf25118c9ea..b9101e994ca 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -44,8 +44,8 @@ GVAR(outputPFH) = [{ private _dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])]; // WP Grid - private _xGrid2 = floor (DAGR_WP_INFO / 10000); - private _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; + private _xGrid2 = floor (GVAR(wp_info) / 10000); + private _yGrid2 = GVAR(wp_info) - _xGrid2 * 10000; private _xCoord2 = switch true do { case (_xGrid2 >= 1000): { "" + str(_xGrid2) }; diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf index 194dc7414bb..a557bea8c00 100644 --- a/addons/explosives/functions/fnc_interactEH.sqf +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -24,7 +24,7 @@ TRACE_1("Explosives interactEH",_interactionType); // If player somehow gets a defusal kit during keyDown, they will just have to reopen menu if ( _interactionType != 0 - || {vehicle ACE_player != ACE_player} + || {!isNull objectParent ACE_player} || {(ACE_player call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1} ) exitWith {}; diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 0cfeee67bd9..c28fb065179 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -8,7 +8,7 @@ // Keybinds ["ACE3 Vehicles", QGVAR(fastRope), localize LSTRING(Interaction_fastRope), { - if ((vehicle ACE_player) == ACE_player) exitWith {false}; + if (isNull objectParent ACE_player) 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); @@ -19,7 +19,7 @@ }, ""] call CBA_fnc_addKeybind; ["ACE3 Vehicles", QGVAR(cutRopes), localize LSTRING(Interaction_cutRopes), { - if ((vehicle ACE_player) == ACE_player) exitWith {false}; + if (isNull objectParent ACE_player) 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); diff --git a/addons/field_rations/functions/fnc_addWaterSourceInteractions.sqf b/addons/field_rations/functions/fnc_addWaterSourceInteractions.sqf index d45ea877ca0..1154adc68fe 100644 --- a/addons/field_rations/functions/fnc_addWaterSourceInteractions.sqf +++ b/addons/field_rations/functions/fnc_addWaterSourceInteractions.sqf @@ -21,7 +21,7 @@ params ["_interactionType"]; // Ignore when self-interaction, mounted vehicle interaction, or water source actions are disabled if ( _interactionType != 0 - || {vehicle ACE_player != ACE_player} + || {!isNull objectParent ACE_player} || {XGVAR(waterSourceActions) == 0} ) exitWith {}; diff --git a/addons/field_rations/functions/fnc_consumeItem.sqf b/addons/field_rations/functions/fnc_consumeItem.sqf index 2c3b6f815ad..ac619d7e07e 100644 --- a/addons/field_rations/functions/fnc_consumeItem.sqf +++ b/addons/field_rations/functions/fnc_consumeItem.sqf @@ -52,12 +52,12 @@ _consumeText = format [_consumeText, _displayName]; private _stanceIndex = ["STAND", "CROUCH", "PRONE"] find stance _player; // Handle in vehicle when stance is UNDEFINED -if (vehicle _player != _player) then {_stanceIndex = 0}; +if (!isNull objectParent _player) then {_stanceIndex = 0}; private _consumeAnim = getArray (_config >> QXGVAR(consumeAnims)) param [_stanceIndex, "", [""]]; private _consumeSound = getArray (_config >> QXGVAR(consumeSounds)) param [_stanceIndex, "", [""]]; -private _soundPlayed = if (_consumeAnim != "" && {vehicle _player == _player && {!(_player call EFUNC(common,isSwimming))}}) then { +private _soundPlayed = if (_consumeAnim != "" && {isNull objectParent _player && {!(_player call EFUNC(common,isSwimming))}}) then { // Store current animation for resetting _player setVariable [QGVAR(previousAnim), animationState _player]; [_player, _consumeAnim, 1] call EFUNC(common,doAnimation); @@ -109,7 +109,7 @@ private _fnc_onFailure = { TRACE_1("Consume item failed",_args); // Reset animation if needed - if (vehicle _player == _player && {!(_player call EFUNC(common,isSwimming))}) then { + if (isNull objectParent _player && {!(_player call EFUNC(common,isSwimming))}) then { private _previousAnim = _player getVariable [QGVAR(previousAnim), ""]; if (_previousAnim != "") then { [_player, _previousAnim, 2] call EFUNC(common,doAnimation); diff --git a/addons/field_rations/functions/fnc_drinkFromSource.sqf b/addons/field_rations/functions/fnc_drinkFromSource.sqf index cf0d18018b1..74e9905eba7 100644 --- a/addons/field_rations/functions/fnc_drinkFromSource.sqf +++ b/addons/field_rations/functions/fnc_drinkFromSource.sqf @@ -46,7 +46,7 @@ private _fnc_onFailure = { _args params ["_player"]; // Reset animation if needed - if (vehicle _player == _player && {!(_player call EFUNC(common,isSwimming))}) then { + if (isNull objectParent _player && {!(_player call EFUNC(common,isSwimming))}) then { private _previousAnim = _player getVariable [QGVAR(previousAnim), ""]; if (_previousAnim != "") then { [_player, _previousAnim, 2] call EFUNC(common,doAnimation); diff --git a/addons/field_rations/functions/fnc_update.sqf b/addons/field_rations/functions/fnc_update.sqf index f66573824b8..762af12d883 100644 --- a/addons/field_rations/functions/fnc_update.sqf +++ b/addons/field_rations/functions/fnc_update.sqf @@ -35,7 +35,7 @@ private _hunger = _player getVariable [QXGVAR(hunger), 0]; // Determine base change based on work multiplier private _currentWork = 1; -if (vehicle _player == _player && {isTouchingGround _player}) then { +if (isNull objectParent _player && {isTouchingGround _player}) then { private _speed = vectorMagnitude velocity _player; _currentWork = linearConversion [2, 7, _speed, 1, 2, true]; }; diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index 16dca938b34..5ffd91500d7 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -20,7 +20,7 @@ if (!alive ACE_player) exitWith {false}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; //make sure player is dismounted or in a static weapon: -if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) exitWith {false}; +if ((!isNull objectParent ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) exitWith {false}; //Check camera view (not in GUNNER) if !(cameraView in ["INTERNAL", "EXTERNAL"]) exitWith {false}; //Exit if run recently (run every 1 seconds) @@ -46,7 +46,7 @@ private _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)] { if ((((eyePos _x) vectorDistance _playerEyePosASL) < GVAR(maxRange)) && {alive _x} && - {(_x == (vehicle _x)) || {(vehicle _x) isKindOf "StaticWeapon"}} && + {(isNull objectParent _x) || {(vehicle _x) isKindOf "StaticWeapon"}} && {GVAR(indicatorForSelf) || {_x != ACE_player}} && {((lineIntersectsSurfaces [(eyePos _x), _playerEyePosASL, vehicle ACE_player, vehicle _x]) isEqualTo [])} && {[_x] call EFUNC(common,isPlayer)}) then { diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index 36acea8a447..76300f3a141 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -19,7 +19,7 @@ if (!alive ACE_player) then {GVAR(fingersHash) = createHashMap}; // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = createHashMap}; // Make sure player is dismounted or in a static weapon: -if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = createHashMap}; +if ((!isNull objectParent ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = createHashMap}; private _iconBaseSize = GVAR(sizeCoef) * BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom)); diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index d87f6cfa3ba..1ed969b04a7 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -62,7 +62,7 @@ GVAR(openedMenuType) = _menuType; GVAR(lastTimeSearchedActions) = -1000; GVAR(ParsedTextCached) = []; -GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || +GVAR(useCursorMenu) = (!isNull objectParent ACE_player) || (!(isNull (ACE_controlledUAV select 0))) || visibleMap || (!isNull curatorCamera) || @@ -117,7 +117,7 @@ GVAR(selfMenuOffset) = (AGLToASL (positionCameraToWorld [0, 0, 2])) vectorDiff ( if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { if (isNull (ACE_controlledUAV select 0)) then { - if (vehicle ACE_player != ACE_player) then { + if (!isNull objectParent ACE_player) then { GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]]; GVAR(expanded) = true; GVAR(expandedTime) = diag_tickTime; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 1887a6d790e..a44d37522b9 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -124,7 +124,7 @@ GVAR(collectedActionPoints) resize 0; if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { if (isNull (ACE_controlledUAV select 0)) then { - if (vehicle ACE_player == ACE_player) then { + if (isNull objectParent ACE_player) then { if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { // Once every 0.2 secs, collect nearby objects active and visible action points and render them call _fnc_renderNearbyActions; diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 5af5afcc7ca..7711c812f02 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -37,7 +37,7 @@ private _pos = if((count _this) > 2) then { // For non-self actions, exit if the action is too far away or ocluded private _distanceToBasePoint = 0; //This will be 0 for self/zeus/in-vehicle (used later to check sub action distance) -if ((GVAR(openedMenuType) == 0) && {isNull (ACE_controlledUAV select 0)} && {vehicle ACE_player == ACE_player} && {isNull curatorCamera} && +if ((GVAR(openedMenuType) == 0) && {isNull (ACE_controlledUAV select 0)} && {isNull objectParent ACE_player} && {isNull curatorCamera} && { private _headPos = ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"); _distanceToBasePoint = _headPos distance _pos; diff --git a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf index b87f6133f35..f0b503437d5 100644 --- a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf @@ -23,7 +23,7 @@ if (!GVAR(addBuildingActions)) exitWith {}; //Ignore self-interaction menu: if (_interactionType != 0) exitWith {}; //Ignore when mounted: -if ((vehicle ACE_player) != ACE_player) exitWith {}; +if (!isNull objectParent ACE_player) exitWith {}; [{ params ["_args", "_pfID"]; diff --git a/addons/interaction/functions/fnc_canPassMagazine.sqf b/addons/interaction/functions/fnc_canPassMagazine.sqf index 97478bffa7c..9964cdaed9c 100644 --- a/addons/interaction/functions/fnc_canPassMagazine.sqf +++ b/addons/interaction/functions/fnc_canPassMagazine.sqf @@ -20,7 +20,7 @@ params ["_player", "_target", "_weapon"]; if (!GVAR(enableMagazinePassing)) exitWith {false}; if (_weapon isEqualTo "" || {!(_target call EFUNC(common,isAwake))}) exitWith {false}; -if (((vehicle _target) != _target) && {(vehicle _target) != (vehicle _player)}) exitWith {false}; +if ((!isNull objectParent _target) && {(vehicle _target) != (vehicle _player)}) exitWith {false}; private _compatibleMags = [_weapon] call CBA_fnc_compatibleMagazines; diff --git a/addons/javelin/functions/fnc_showFireMode.sqf b/addons/javelin/functions/fnc_showFireMode.sqf index a3315188f1f..89d55f98a38 100644 --- a/addons/javelin/functions/fnc_showFireMode.sqf +++ b/addons/javelin/functions/fnc_showFireMode.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_currentShooter"]; // from upper scope -(if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { +(if ((isNull objectParent ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { weaponState ACE_player } else { private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index 6f5b3218b01..2e33601ccea 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -23,7 +23,7 @@ params ["_interactionType"]; // If player somehow gets a wirecutter during keyDown, they will just have to reopen menu if ( _interactionType != 0 - || {vehicle ACE_player != ACE_player} + || {!isNull objectParent ACE_player} || {!HAS_WIRECUTTER(ACE_player)} ) exitWith {}; diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf index cf6e01bf212..0a6efdd1f71 100644 --- a/addons/map/functions/fnc_updateMapEffects.sqf +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -34,7 +34,7 @@ if (GVAR(mapShake)) then { // Only shake map while moving on foot private _speed = 0; - if ((alive ACE_player) && {vehicle ACE_player == ACE_player}) then { + if ((alive ACE_player) && {isNull objectParent ACE_player}) then { _speed = vectorMagnitude (velocity ACE_player); }; diff --git a/addons/medical_ai/functions/fnc_canRequestMedic.sqf b/addons/medical_ai/functions/fnc_canRequestMedic.sqf index 5064e1a7321..d020d02e1dc 100644 --- a/addons/medical_ai/functions/fnc_canRequestMedic.sqf +++ b/addons/medical_ai/functions/fnc_canRequestMedic.sqf @@ -20,7 +20,7 @@ // treat other units, or else he won't do anything on his own. private _isMedic = [_this] call EFUNC(medical_treatment,isMedic); -if (_isMedic && {!IS_UNCONSCIOUS(_this)} || {vehicle _this != _this}) exitWith {false}; +if (_isMedic && {!IS_UNCONSCIOUS(_this)} || {!isNull objectParent _this}) exitWith {false}; // Search for a medic, prioritize unitReady private _medic = objNull; diff --git a/addons/medical_feedback/XEH_postInit.sqf b/addons/medical_feedback/XEH_postInit.sqf index f01394e9199..731fd1f8859 100644 --- a/addons/medical_feedback/XEH_postInit.sqf +++ b/addons/medical_feedback/XEH_postInit.sqf @@ -38,7 +38,7 @@ GVAR(bloodTickCounter) = 0; if (_unit != ACE_player) exitWith {}; TRACE_1("player unconscious eh",_unconscious); - if (_unconscious && {cameraView == "GUNNER"} && {(vehicle _unit) != _unit} && {cameraOn == vehicle _unit}) then { + if (_unconscious && {cameraView == "GUNNER"} && {!isNull objectParent _unit} && {cameraOn == vehicle _unit}) then { TRACE_2("exiting gunner view",cameraOn,cameraView); ACE_player switchCamera "INTERNAL"; }; diff --git a/addons/medical_gui/functions/fnc_canOpenMenu.sqf b/addons/medical_gui/functions/fnc_canOpenMenu.sqf index fc2ac3879e7..d8344a4012a 100644 --- a/addons/medical_gui/functions/fnc_canOpenMenu.sqf +++ b/addons/medical_gui/functions/fnc_canOpenMenu.sqf @@ -28,4 +28,4 @@ if (!isNull findDisplay 312) exitWith { _player call EFUNC(common,isAwake) && {!isNull _target} && {_player distance _target < GVAR(maxDistance) || {vehicle _player == vehicle _target}} && -{GVAR(enableMedicalMenu) == 1 || {GVAR(enableMedicalMenu) == 2 && {vehicle _player != _player || {vehicle _target != _target}}}} +{GVAR(enableMedicalMenu) == 1 || {GVAR(enableMedicalMenu) == 2 && {!isNull objectParent _player || {!isNull objectParent _target}}}} diff --git a/addons/medical_treatment/functions/fnc_canTreat_holsterCheck.sqf b/addons/medical_treatment/functions/fnc_canTreat_holsterCheck.sqf index c903fc88d7b..94c0e63fffe 100644 --- a/addons/medical_treatment/functions/fnc_canTreat_holsterCheck.sqf +++ b/addons/medical_treatment/functions/fnc_canTreat_holsterCheck.sqf @@ -20,8 +20,8 @@ params ["_medic", "_patient", "_config"]; GVAR(holsterRequired) == 0 -|| {vehicle _medic != _medic} // medic is in a vehicle, so weapon is considered holstered -|| {vehicle _patient != _patient} // patient is in a vehicle, ^ +|| {!isNull objectParent _medic} // medic is in a vehicle, so weapon is considered holstered +|| {!isNull objectParent _patient} // patient is in a vehicle, ^ || {(GVAR(holsterRequired) in [2,4]) && {getText (_config >> "category") == "examine"}} // if examine bypass is on || {currentWeapon _medic isEqualTo ""} // weapon is holstered || {(GVAR(holsterRequired) <= 2) && {weaponLowered _medic}} // if just lowered is allowed diff --git a/addons/medical_treatment/functions/fnc_createLitter.sqf b/addons/medical_treatment/functions/fnc_createLitter.sqf index df9c2e7f4de..4a873272aa8 100644 --- a/addons/medical_treatment/functions/fnc_createLitter.sqf +++ b/addons/medical_treatment/functions/fnc_createLitter.sqf @@ -24,7 +24,7 @@ if (!GVAR(allowLitterCreation)) exitWith {}; params ["_medic", "_patient", "_bodyPart", "_classname"]; // Don't create litter if medic or patient are inside a vehicle -if (vehicle _medic != _medic || {vehicle _patient != _patient}) exitWith {}; +if (!isNull objectParent _medic || {!isNull objectParent _patient}) exitWith {}; // Determine if treated body part is bleeding private _index = ALL_BODY_PARTS find toLowerANSI _bodyPart; diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index 5f6df40e31c..4a28212966d 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -97,7 +97,7 @@ if (_medic isNotEqualTo player || {!_isInZeus}) then { }; // Play treatment animation for medic and determine the ending animation - if (vehicle _medic == _medic && {_medicAnim != ""}) then { + if (isNull objectParent _medic && {_medicAnim != ""}) then { // Speed up animation based on treatment time (but cap max to prevent odd animiations/cam shake) private _animRatio = _animDuration / _treatmentTime; TRACE_3("setAnimSpeedCoef",_animRatio,_animDuration,_treatmentTime); diff --git a/addons/microdagr/functions/fnc_canShow.sqf b/addons/microdagr/functions/fnc_canShow.sqf index 141fad9ed01..fcc99f6dbf2 100644 --- a/addons/microdagr/functions/fnc_canShow.sqf +++ b/addons/microdagr/functions/fnc_canShow.sqf @@ -26,7 +26,7 @@ _returnValue = switch (_showType) do { }; case (DISPLAY_MODE_DISPLAY): { //Can't have minimap up while zoomed in on foot, but allow drivers to use while in "Gunner" to handle non-3d vehicles like most tanks - ((cameraView != "GUNNER") || {(vehicle ACE_player != ACE_player) && {driver vehicle ACE_player == ACE_player}}) && + ((cameraView != "GUNNER") || {(!isNull objectParent ACE_player) && {driver vehicle ACE_player == ACE_player}}) && {"ACE_microDAGR" in (ACE_player call EFUNC(common,uniqueItems))} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)} }; diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index f8494e474c5..684ad8be76b 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -25,7 +25,7 @@ private _currentShooter = objNull; private _currentMagazine = ""; private _turretPath = []; if (isNull (ACE_controlledUAV param [0, objNull])) then { - if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { + if ((isNull objectParent ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { _currentShooter = ACE_player; _currentMagazine = currentMagazine ACE_player; } else { diff --git a/addons/missileguidance/functions/fnc_wire_onFired.sqf b/addons/missileguidance/functions/fnc_wire_onFired.sqf index 870754c5091..55874e00c69 100644 --- a/addons/missileguidance/functions/fnc_wire_onFired.sqf +++ b/addons/missileguidance/functions/fnc_wire_onFired.sqf @@ -26,7 +26,7 @@ private _maxDistanceSqr = _seekerMaxRange * _seekerMaxRange; private _minDistanceSqr = _seekerMinRange * _seekerMinRange; // AI don't know how to use the crosshair offset becauze they dum dum -private _crosshairOffset = if ((_gunner != ACE_PLAYER) && {_gunner != (ACE_controlledUAV select 1)}) then { +private _crosshairOffset = if ((_gunner != ACE_player) && {_gunner != (ACE_controlledUAV select 1)}) then { [0, 0, 0]; } else { [_config >> "offsetFromCrosshair", "ARRAY", [0, 0, 0]] call CBA_fnc_getConfigEntry diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 4d7cc5ba120..4fa7e066c0b 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -10,7 +10,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (ACE_player != (vehicle ACE_player)) exitWith {false}; + if (!isNull objectParent ACE_player) exitWith {false}; // Statement [ACE_player] call FUNC(climb); diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index 75a24e528d8..a43293b5a72 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -88,7 +88,7 @@ if (_enabledTagsNearby) then { {!isObjectHidden _x} }; private _crewMen = []; - if (vehicle ACE_player != ACE_player) then { + if (!isNull objectParent ACE_player) then { _crewMen = (crew vehicle ACE_player) select { _x != ACE_player && {(side group _x) == (side group ACE_player)} && diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index 2c7dedaa834..6ed6aa1d687 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -30,7 +30,7 @@ private _blurRadius = -1; private _preset = getArray (configFile >> "CfgWeapons" >> "NVGoggles" >> QGVAR(colorPreset)); if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) then { - if (((vehicle ACE_player) == ACE_player) || { + if ((isNull objectParent ACE_player) || { // Test if we are using player's nvg or if sourced from vehicle: private _currentVehicle = vehicle ACE_player; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index f727413d4a5..ee4c588f3e1 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -30,7 +30,7 @@ _opValues params ["_overpressureAngle", "_overpressureRange", "_overpressureDama TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); { - if (local _x && {_x != _firer} && {vehicle _x == _x}) then { + if (local _x && {_x != _firer} && {isNull objectParent _x}) then { private _targetPositionASL = eyePos _x; private _relativePosition = _targetPositionASL vectorDiff _posASL; private _axisDistance = _relativePosition vectorDotProduct _direction; diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf index da47bc3c725..62b413c71d7 100644 --- a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -69,7 +69,7 @@ TRACE_2("start",_unit,_nozzle); END_PFH }; - if (_unit == vehicle _unit && {_unit isNotEqualTo ACE_player}) exitWith { + if (isNull objectParent _unit && {_unit isNotEqualTo ACE_player}) exitWith { TRACE_2("stop vehicle/player",_unit,vehicle _unit); DROP_NOZZLE UNHOLSTER_WEAPON diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index ae4038daf0a..c8f00812998 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -163,7 +163,7 @@ if (_currentWeapon == secondaryWeapon _caller) then { private _wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _caller, handgunWeapon _caller] find (currentWeapon _caller))); _callerAnim = [_callerAnim, "[wpn]", _wpn] call CBA_fnc_replace; -if (vehicle _caller == _caller && {_callerAnim != ""}) then { +if (isNull objectParent _caller && {_callerAnim != ""}) then { if (primaryWeapon _caller == "") then { _caller addWeapon "ACE_FakePrimaryWeapon"; }; diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index 0c7fcbf9af3..9d49bd46b06 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -32,7 +32,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeEventHandler ["AnimDone", _caller getVariable [QGVAR(repairLoopAnimEh), -1]]; _caller setVariable [QGVAR(repairLoopAnimEh), nil]; -if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) then { +if (isNull objectParent _caller && {!(_caller call EFUNC(common,isSwimming))}) then { [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); }; _caller setVariable [QGVAR(repairCurrentAnimCaller), nil]; diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 94ffd819e31..2f729330966 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -32,7 +32,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeEventHandler ["AnimDone", _caller getVariable [QGVAR(repairLoopAnimEh), -1]]; _caller setVariable [QGVAR(repairLoopAnimEh), nil]; -if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) then { +if (isNull objectParent _caller && {!(_caller call EFUNC(common,isSwimming))}) then { [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); }; _caller setVariable [QGVAR(repairCurrentAnimCaller), nil]; diff --git a/addons/spectator/functions/fnc_cam_tick.sqf b/addons/spectator/functions/fnc_cam_tick.sqf index 11f257b7d5a..273aa69ecfc 100644 --- a/addons/spectator/functions/fnc_cam_tick.sqf +++ b/addons/spectator/functions/fnc_cam_tick.sqf @@ -64,12 +64,12 @@ if (isNull _camTarget) then { private _targetInVeh = GVAR(camTargetInVehicle); if (GVAR(camHasTarget)) then { - if (!_targetInVeh && { vehicle _camTarget != _camTarget }) then { + if (!_targetInVeh && { !isNull objectParent _camTarget }) then { [_camTarget] call FUNC(cam_setTarget); GVAR(camTargetInVehicle) = true; }; - if (_targetInVeh && { vehicle _camTarget == _camTarget }) then { + if (_targetInVeh && { isNull objectParent _camTarget }) then { [_camTarget] call FUNC(cam_setTarget); GVAR(camTargetInVehicle) = false; }; diff --git a/addons/spectator/functions/fnc_getGroupIcon.sqf b/addons/spectator/functions/fnc_getGroupIcon.sqf index 64db9e72974..2c464c5b664 100644 --- a/addons/spectator/functions/fnc_getGroupIcon.sqf +++ b/addons/spectator/functions/fnc_getGroupIcon.sqf @@ -51,7 +51,7 @@ if (isNull _leader) exitWith { [ICON_UNKNOWN, CIV_ICON_UNKNOWN] select (side _gr // Civilians are easy, just check leader's vehicle (unlikely group is large) if (side _group == civilian) exitWith { - if (_leader != vehicle _leader) then { + if (!isNull objectParent _leader) then { // More common cases should be checked first (vehicle _leader) call { if (_this isKindOf "Car") exitWith { diff --git a/addons/spectator/functions/fnc_ui_updateWidget.sqf b/addons/spectator/functions/fnc_ui_updateWidget.sqf index 78128d3b000..22858458f15 100644 --- a/addons/spectator/functions/fnc_ui_updateWidget.sqf +++ b/addons/spectator/functions/fnc_ui_updateWidget.sqf @@ -31,7 +31,7 @@ if !(isPlayer _focus) then { _name = format ["%1: %2", localize "str_player_ai", private _unitTypePicture = ""; private _vehicleTypePicture = ""; private _vehiclePositionPicture = ""; -if (_focus != vehicle _focus) then { +if (!isNull objectParent _focus) then { _vehicleTypePicture = getText (configOf vehicle _focus >> "Picture"); _vehiclePositionPicture = switch (_focus) do { diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index ba9c3f77b30..49990959b7a 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -18,7 +18,7 @@ params ["_playerUnit"]; -if (vehicle _playerUnit == _playerUnit) then { +if (isNull objectParent _playerUnit) then { [GVAR(switchableSides)] call FUNC(markAiOnMap); _playerUnit setVariable [QGVAR(IsPlayerUnit), true, true]; diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index f8ccc59a0fd..2c355fa3b37 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -23,7 +23,7 @@ TRACE_2("params",_unit,_container); if (_unit != ACE_player) exitWith {}; if (GVAR(LockVehicleInventory) && //if setting not enabled - {(vehicle ACE_player) == ACE_player} && //Player dismounted + {isNull objectParent ACE_player} && //Player dismounted {(_container isKindOf "Car") || {(_container isKindOf "Tank") || {_container isKindOf "Helicopter"}}} && //container is a lockable veh {(locked _container) in [2,3]} && //Vehicle is locked {!([ACE_player, _container] call FUNC(hasKeyForVehicle))} //player doesn't have key diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index e9f05de8bbd..abb3da3e10d 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -122,7 +122,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !((ACE_player != vehicle ACE_player) && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; + if !(!isNull objectParent ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; // Statement vehicle ACE_player engineOn true; @@ -135,7 +135,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; + if !(!isNull objectParent ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; // Statement vehicle ACE_player engineOn false; @@ -148,7 +148,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; + if (isNull objectParent ACE_player) exitWith {false}; // Statement [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); @@ -161,7 +161,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; + if (isNull objectParent ACE_player) exitWith {false}; // Statement [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); @@ -174,7 +174,7 @@ if (!hasInterface) exitWith {}; // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; + if (isNull objectParent ACE_player) exitWith {false}; // Statement [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); diff --git a/addons/zeus/functions/fnc_moduleGarrison.sqf b/addons/zeus/functions/fnc_moduleGarrison.sqf index dcebd5f1fbb..50716401f7c 100644 --- a/addons/zeus/functions/fnc_moduleGarrison.sqf +++ b/addons/zeus/functions/fnc_moduleGarrison.sqf @@ -51,7 +51,7 @@ switch (false) do { private _units = units _unit; // Make sure all units are disembarked { - if (vehicle _x != _x && {!isPlayer _x}) then { + if (!isNull objectParent _x && {!isPlayer _x}) then { moveOut _x; }; } forEach _units;