mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
26fe041342
* Move gunbag type from inheritance to config property * Add gunbag framework wiki * Remove _generalMacro from doc * Apply documentation suggestions Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
33 lines
699 B
Plaintext
33 lines
699 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Ir0n1E
|
|
* Calculate mass of weapon and items.
|
|
*
|
|
* Arguments:
|
|
* 0: Weapon <STRING>
|
|
* 1: Items <ARRAY>
|
|
* 2: Magazines <ARRAY>
|
|
*
|
|
* Return Value:
|
|
* Mass <NUMBER>
|
|
*
|
|
* Example:
|
|
* ["weapon", ["item1", "item2"], ["mag1", "mag2"]] call ace_gunbag_fnc_calculateMass
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_weapon", "_items", "_magazines"];
|
|
|
|
private _mass = getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass");
|
|
|
|
{
|
|
_mass = _mass + getNumber (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "mass");
|
|
} foreach _items;
|
|
|
|
{
|
|
_mass = _mass + getNumber (configFile >> "CfgMagazines" >> _x >> "mass");
|
|
} forEach _magazines;
|
|
|
|
_mass
|