ACE3/addons/gunbag/functions/fnc_calculateMass.sqf

26 lines
455 B
Plaintext
Raw Normal View History

2016-05-04 07:56:33 +00:00
/*
* Author: Ir0n1E
* calculate mass of weapon an items
*
* Arguments:
* 0: Weapon <STRING>
* 1: Items <ARRAY>
*
* Return Value:
* Mass <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
params ["_weapon","_items"];
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-05-17 09:21:48 +00:00
_mass