mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fixed dragging getWeight
This commit is contained in:
parent
1a0abf31fd
commit
81068e6086
@ -4,7 +4,7 @@
|
|||||||
* Returns the weight of a crate.
|
* Returns the weight of a crate.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Crate to get weight of <OBJECT>
|
* 0: Crate to get weight of <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Total Weight <NUMBER>
|
* Total Weight <NUMBER>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private "_totalWeight";
|
private "_totalWeight";
|
||||||
|
params ["_object"];
|
||||||
// Initialize the total weight.
|
// Initialize the total weight.
|
||||||
_totalWeight = 0;
|
_totalWeight = 0;
|
||||||
|
|
||||||
@ -32,14 +32,14 @@ _totalWeight = 0;
|
|||||||
} forEach _item;
|
} forEach _item;
|
||||||
true
|
true
|
||||||
} count [
|
} count [
|
||||||
[getMagazineCargo _this, {configFile >> "CfgMagazines" >> _x}],
|
[getMagazineCargo _object, {configFile >> "CfgMagazines" >> _x}],
|
||||||
[getBackpackCargo _this, {configFile >> "CfgVehicles" >> _x}],
|
[getBackpackCargo _object, {configFile >> "CfgVehicles" >> _x}],
|
||||||
[getItemCargo _this, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}],
|
[getItemCargo _object, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}],
|
||||||
[getWeaponCargo _this, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}]
|
[getWeaponCargo _object, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}]
|
||||||
];
|
];
|
||||||
|
|
||||||
// add Weight of create to totalWeight
|
// 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).
|
// 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
|
_totalWeight * 0.5
|
||||||
|
Loading…
Reference in New Issue
Block a user