2015-08-10 21:07:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2016-01-19 03:53:48 +00:00
|
|
|
* Handle object being destroyed. Only runs on server.
|
2015-08-10 21:07:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Object <OBJECT>
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
2015-08-16 20:41:35 +00:00
|
|
|
* Example:
|
|
|
|
* [object] call ace_cargo_fnc_handleDestroyed
|
|
|
|
*
|
2015-08-10 21:07:47 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_vehicle"];
|
2016-01-19 03:53:48 +00:00
|
|
|
TRACE_1("params",_vehicle);
|
2015-08-10 21:07:47 +00:00
|
|
|
|
2016-01-19 03:53:48 +00:00
|
|
|
private _loaded = _vehicle getVariable [QGVAR(loaded), []];
|
2015-09-27 16:19:40 +00:00
|
|
|
if (_loaded isEqualTo []) exitWith {};
|
2015-08-10 21:07:47 +00:00
|
|
|
|
|
|
|
{
|
2015-09-27 16:19:40 +00:00
|
|
|
// TODO Do we want to be able to recover destroyed equipment?
|
2015-11-20 17:40:31 +00:00
|
|
|
if (_x isEqualType objNull) then {
|
2015-09-27 16:19:40 +00:00
|
|
|
deleteVehicle _x;
|
|
|
|
};
|
2016-01-19 03:53:48 +00:00
|
|
|
nil
|
2015-08-14 16:07:31 +00:00
|
|
|
} count _loaded;
|
2015-08-10 21:07:47 +00:00
|
|
|
|
|
|
|
[_vehicle] call FUNC(validateCargoSpace);
|