ACE3/addons/cargo/functions/fnc_getSizeItem.sqf

30 lines
563 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-08-10 21:07:47 +00:00
/*
* Author: Glowbal, kymckay
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: Item <OBJECT or STRING>
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:
* [object] 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
// Virtual items are much easier to deal with
if (_item isEqualType "") then {
CARGO_SIZE(_item)
} else {
if (isNil {_item getVariable QGVAR(size)}) then {
CARGO_SIZE(typeOf _item)
} else {
_item getVariable QGVAR(size)
};
2015-08-10 21:07:47 +00:00
};