ACE3/addons/cargo/functions/fnc_getSizeItem.sqf
SilentSpike fea2326488 Add cargo eden attributes (#4780)
- Add a ace_cargo_space attribute to vehicles to alter how much cargo they can carry.
- Add an ace_cargo_size attribute to objects to alter how much cargo space they consume.
- Add two public functions `fnc_setSize.sqf` and `fnc_setSpace.sqf` to update the cargo size/space respectively of any given object.
- Deprecate cargo makeLoadable module and public function.
- Added some macros to get the space/size of a config, making code more readable in places.
2017-05-31 23:54:57 +01:00

30 lines
564 B
Plaintext

/*
* Author: Glowbal, SilentSpike
* Get the cargo size of an object.
*
* Arguments:
* 0: Item <OBJECT or STRING>
*
* Return Value:
* Cargo size <NUMBER> (default: -1)
*
* Example:
* [object] call ace_cargo_fnc_getSizeItem
*
* Public: No
*/
#include "script_component.hpp"
params ["_item"];
// 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)
};
};