2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-05-04 07:56:33 +00:00
|
|
|
/*
|
|
|
|
* Author: Ir0n1E
|
2019-06-05 01:00:55 +00:00
|
|
|
* Calculate mass of weapon and items.
|
2016-05-04 07:56:33 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Weapon <STRING>
|
|
|
|
* 1: Items <ARRAY>
|
2016-06-12 11:51:23 +00:00
|
|
|
* 2: Magazines <ARRAY>
|
2016-05-04 07:56:33 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Mass <NUMBER>
|
|
|
|
*
|
2016-06-12 21:56:00 +00:00
|
|
|
* Example:
|
|
|
|
* ["weapon", ["item1", "item2"], ["mag1", "mag2"]] call ace_gunbag_fnc_calculateMass
|
|
|
|
*
|
2016-05-04 07:56:33 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-06-12 11:51:23 +00:00
|
|
|
params ["_weapon", "_items", "_magazines"];
|
2016-05-04 07:56:33 +00:00
|
|
|
|
|
|
|
private _mass = getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass");
|
|
|
|
|
|
|
|
{
|
2016-05-17 09:21:48 +00:00
|
|
|
_mass = _mass + getNumber (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "mass");
|
2016-05-04 07:56:33 +00:00
|
|
|
} foreach _items;
|
|
|
|
|
2016-06-12 11:51:23 +00:00
|
|
|
{
|
2016-08-09 16:20:25 +00:00
|
|
|
_mass = _mass + getNumber (configFile >> "CfgMagazines" >> _x >> "mass");
|
2016-06-12 11:51:23 +00:00
|
|
|
} forEach _magazines;
|
|
|
|
|
2016-05-17 09:21:48 +00:00
|
|
|
_mass
|