From 8cdf0b2c686e9d763b950222e897eea154018aea Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 19 Oct 2021 13:17:59 -0500 Subject: [PATCH] Revert "Common - Fix calling getVar on null object in `canInteractWith` (#8532)" (#8564) This reverts commit a0e9f6015b1d16cf6982ff3443865f4955e282fc. --- addons/common/functions/fnc_canInteractWith.sqf | 7 +++---- addons/movement/functions/fnc_handleVirtualMass.sqf | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 62fbba322e..b67e57964f 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -21,11 +21,10 @@ params ["_unit", "_target", ["_exceptions", []]]; _exceptions = _exceptions apply {toLower _x}; +private _owner = _target getVariable [QGVAR(owner), objNull]; + // exit if the target is not free to interact -if ((!isNull _target) && { - private _owner = _target getVariable [QGVAR(owner), objNull]; - (!isNull _owner) && {_unit != _owner}} -) exitWith {false}; +if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; diff --git a/addons/movement/functions/fnc_handleVirtualMass.sqf b/addons/movement/functions/fnc_handleVirtualMass.sqf index f2c0655b5c..8f035cc5ad 100644 --- a/addons/movement/functions/fnc_handleVirtualMass.sqf +++ b/addons/movement/functions/fnc_handleVirtualMass.sqf @@ -23,9 +23,7 @@ if (isNull _unit) exitWith {}; private _virtualLoad = 0; { - if (!isNull _x) then { - _virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]); - }; + _virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]); } forEach [ _unit, uniformContainer _unit,