2015-08-10 21:07:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2015-08-16 20:41:35 +00:00
|
|
|
* Get the cargo size of an object.
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Object <OBJECT>
|
|
|
|
*
|
|
|
|
* Return value:
|
2015-08-16 20:41:35 +00:00
|
|
|
* Cargo size <NUMBER> (default: -1)
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [object] call ace_cargo_fnc_getSizeItem
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-14 16:42:22 +00:00
|
|
|
private "_config";
|
2015-08-16 20:41:35 +00:00
|
|
|
|
2015-08-14 16:42:22 +00:00
|
|
|
params ["_item"];
|
2015-08-16 20:41:35 +00:00
|
|
|
|
2015-08-18 21:51:30 +00:00
|
|
|
_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size));
|
2015-08-16 20:41:35 +00:00
|
|
|
|
|
|
|
if (isNumber (_config)) exitWith {
|
2015-08-16 20:48:52 +00:00
|
|
|
_item getVariable [QGVAR(size), getNumber (_config)]
|
2015-08-10 21:07:47 +00:00
|
|
|
};
|
2015-08-16 20:41:35 +00:00
|
|
|
|
2015-08-14 16:07:31 +00:00
|
|
|
-1
|