From 68738316c291feed25905e999afb3ae5a5d01179 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:13:44 +0200 Subject: [PATCH] Dragging - Remove weight calculation workaround (#10117) * loadAbs has been fixed * Update fnc_getWeight.sqf --- addons/dragging/functions/fnc_getWeight.sqf | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index f6b93feca0..f6cb466165 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -11,7 +11,7 @@ * Weight * * Example: - * [cursorTarget] call ace_dragging_fnc_getWeight + * cursorTarget call ace_dragging_fnc_getWeight * * Public: No */ @@ -23,19 +23,20 @@ if (GVAR(weightCoefficient) == 0) exitWith {0}; private _weight = loadAbs _object; -if !(GVAR(skipContainerWeight)) then { +if (!GVAR(skipContainerWeight)) then { // Add the mass of the object itself // getMass handles PhysX mass, this should be 0 for SupplyX containers and WeaponHolders // Use originalMass in case we're checking weight for a carried object - _weight = _weight + ((_object getVariable [QGVAR(originalMass), getMass _object])); + _weight = _weight + (_object getVariable [QGVAR(originalMass), getMass _object]); }; -// Contents of backpacks get counted twice (https://github.com/acemod/ACE3/pull/8457#issuecomment-1062522447 and https://feedback.bistudio.com/T167469) -// This is a workaround until that is fixed on BI's end -{ - _x params ["", "_container"]; - _weight = _weight - (loadAbs _container); -} forEach (everyContainer _object); +// Fixed in https://feedback.bistudio.com/T167469 on 2.16 profiling branch and for 2.18 stable +if ((productVersion select 3) < 152017) then { + { + _x params ["", "_container"]; + _weight = _weight - (loadAbs _container); + } forEach (everyContainer _object); +}; // Mass in Arma isn't an exact amount but rather a volume/weight value // This attempts to work around that by making it a usable value (sort of)