/* * Author: Glowbal * Handle object being destroyed. * * Arguments: * 0: Object * * Return value: * None * * Example: * [object] call ace_cargo_fnc_handleDestroyed * * Public: No */ #include "script_component.hpp" params ["_vehicle"]; private["_loaded"]; _loaded = _vehicle getVariable [QGVAR(loaded), []]; if (_loaded isEqualTo []) exitWith {}; { // TODO Do we want to be able to recover destroyed equipment? if (typeName _x == "OBJECT") then { deleteVehicle _x; }; } count _loaded; [_vehicle] call FUNC(validateCargoSpace);