ACE3/addons/cargo/functions/fnc_getSizeItem.sqf
johnb432 d1f0dc5e83
Cargo - Improve various aspects (#9617)
* Update CfgVehicles.hpp

* Cargo cleanup

* Update menu.hpp

* Updated status effect key

* Update fnc_onMenuOpen.sqf

* Update fnc_onMenuOpen.sqf

* fix comment from merge

* nil interaction GVARs on menu close

* fix carry bug

* Fix floating objects in MP

* Updated ace_cargoAdded doc

* Fix progress bar prematurely stopping

* Finer cursor object selection

---------

Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
2023-11-17 20:07:28 -03:00

26 lines
559 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Glowbal, kymckay
* Gets the cargo size of an object.
*
* Arguments:
* 0: Item <STRING> or <OBJECT>
*
* Return Value:
* Cargo size <NUMBER> (default: -1)
*
* Example:
* cursorObject call ace_cargo_fnc_getSizeItem
*
* Public: No
*/
params ["_item"];
// Default cargo size is -1 as 0 is a valid size
if (_item isEqualType "") then {
GET_NUMBER(configFile >> "CfgVehicles" >> _item >> QGVAR(size),-1)
} else {
_item getVariable [QGVAR(size), GET_NUMBER(configOf _item >> QGVAR(size),-1)]
};