mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Small fixes in ace_cargo
Makes paradropItem and unloadItem invoke event "ace_cargoUnloaded" with parameters _itemObject, _vehicle and "paradrop" or "unload" respectivelty. paradropItem invoked said event but if item was classname it would send classname to event which is not particularly useful.
This commit is contained in:
parent
94d5e93485
commit
3af1fb50ab
@ -107,6 +107,6 @@ if (_showHint) then {
|
||||
};
|
||||
|
||||
// Invoke listenable event
|
||||
["ace_cargoUnloaded", [_item, _vehicle, "paradrop"]] call CBA_fnc_globalEvent;
|
||||
["ace_cargoUnloaded", [_itemObject, _vehicle, "paradrop"]] call CBA_fnc_globalEvent;
|
||||
|
||||
true
|
||||
|
@ -47,14 +47,17 @@ private _space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
||||
private _itemSize = [_item] call FUNC(getSizeItem);
|
||||
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
|
||||
|
||||
if (_item isEqualType objNull) then {
|
||||
private _itemObject = if (_item isEqualType objNull) then {
|
||||
detach _item;
|
||||
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
|
||||
// do both on server to ensure they are executed in the correct order
|
||||
[QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
|
||||
_item;
|
||||
} else {
|
||||
private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"];
|
||||
_newItem setPosASL (AGLtoASL _emptyPosAGL);
|
||||
_newItem;
|
||||
};
|
||||
|
||||
// Invoke listenable event
|
||||
["ace_cargoUnloaded", [_itemObject, _vehicle, "unload"]] call CBA_fnc_globalEvent;
|
||||
true
|
||||
|
Loading…
Reference in New Issue
Block a user