2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-10 21:07:47 +00:00
|
|
|
/*
|
2023-08-17 10:02:17 +00:00
|
|
|
* Author: Glowbal, kymckay
|
2023-11-17 23:07:28 +00:00
|
|
|
* Gets the cargo size of an object.
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2023-11-17 23:07:28 +00:00
|
|
|
* 0: Item <STRING> or <OBJECT>
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-08-16 20:41:35 +00:00
|
|
|
* Cargo size <NUMBER> (default: -1)
|
|
|
|
*
|
|
|
|
* Example:
|
2023-11-17 23:07:28 +00:00
|
|
|
* cursorObject call ace_cargo_fnc_getSizeItem
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-14 16:42:22 +00:00
|
|
|
params ["_item"];
|
2016-01-19 03:53:48 +00:00
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
// Default cargo size is -1 as 0 is a valid size
|
2017-05-31 22:54:57 +00:00
|
|
|
if (_item isEqualType "") then {
|
2023-11-17 23:07:28 +00:00
|
|
|
GET_NUMBER(configFile >> "CfgVehicles" >> _item >> QGVAR(size),-1)
|
2015-09-27 16:19:40 +00:00
|
|
|
} else {
|
2023-11-17 23:07:28 +00:00
|
|
|
_item getVariable [QGVAR(size), GET_NUMBER(configOf _item >> QGVAR(size),-1)]
|
2015-08-10 21:07:47 +00:00
|
|
|
};
|