mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
31 lines
734 B
Plaintext
31 lines
734 B
Plaintext
/*
|
|
* Author: Glowbal, ViperMaul
|
|
* Check if item can be unloaded.
|
|
*
|
|
* Arguments:
|
|
* 0: loaded Object <OBJECT>
|
|
* 1: Object <OBJECT>
|
|
* 2: Unloader (player) <OPTIONAL><OBJECT>
|
|
*
|
|
* Return value:
|
|
* Can be unloaded <BOOL>
|
|
*
|
|
* Example:
|
|
* [item, holder] call ace_cargo_fnc_canUnloadItem
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_item", "_vehicle", ["_unloader", objNull]];
|
|
TRACE_2("params",_item,_vehicle);
|
|
|
|
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
|
|
if !(_item in _loaded) exitWith {false};
|
|
|
|
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
|
|
|
|
private _emptyPos = [_vehicle, _itemClass, _unloader] call EFUNC(common,findUnloadPosition);
|
|
|
|
(count _emptyPos) == 3
|