ACE3/addons/cargo/functions/fnc_handleDestroyed.sqf
2015-08-16 22:41:35 +02:00

32 lines
582 B
Plaintext

/*
* Author: Glowbal
* Handle object being destroyed.
*
* Arguments:
* 0: Object <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 (count _loaded == 0) exitWith {};
{
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment?
deleteVehicle _x;
//_x setDamage 1;
} count _loaded;
[_vehicle] call FUNC(validateCargoSpace);