From 81068e608682195ba1507e6ebd7f4564da049cfc Mon Sep 17 00:00:00 2001 From: Glowbal Date: Wed, 26 Aug 2015 10:05:30 +0200 Subject: [PATCH] fixed dragging getWeight --- addons/dragging/functions/fnc_getWeight.sqf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index d4e3c33f60..78b1fa88d9 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -4,7 +4,7 @@ * Returns the weight of a crate. * * Arguments: - * Crate to get weight of + * 0: Crate to get weight of * * Return Value: * Total Weight @@ -17,7 +17,7 @@ #include "script_component.hpp" private "_totalWeight"; - +params ["_object"]; // Initialize the total weight. _totalWeight = 0; @@ -32,14 +32,14 @@ _totalWeight = 0; } forEach _item; true } count [ - [getMagazineCargo _this, {configFile >> "CfgMagazines" >> _x}], - [getBackpackCargo _this, {configFile >> "CfgVehicles" >> _x}], - [getItemCargo _this, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}], - [getWeaponCargo _this, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}] + [getMagazineCargo _object, {configFile >> "CfgMagazines" >> _x}], + [getBackpackCargo _object, {configFile >> "CfgVehicles" >> _x}], + [getItemCargo _object, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}], + [getWeaponCargo _object, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}] ]; // add Weight of create to totalWeight -_totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> _this >> "mass")); +_totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> _object >> "mass")); // 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). _totalWeight * 0.5