ACE3/addons/cargo/functions/fnc_handleDestroyed.sqf

32 lines
582 B
Plaintext
Raw Normal View History

2015-08-10 21:07:47 +00:00
/*
* Author: Glowbal
2015-08-16 20:41:35 +00:00
* Handle object being destroyed.
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"];
2015-08-14 20:46:51 +00:00
private["_loaded"];
2015-08-16 20:41:35 +00:00
_loaded = _vehicle getVariable [QGVAR(loaded), []];
if (count _loaded == 0) exitWith {};
2015-08-10 21:07:47 +00:00
{
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment?
deleteVehicle _x;
//_x setDamage 1;
} count _loaded;
2015-08-10 21:07:47 +00:00
[_vehicle] call FUNC(validateCargoSpace);