ACE3/addons/cargo/functions/fnc_handleDestroyed.sqf

33 lines
618 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
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>
*
2016-06-18 09:50:41 +00:00
* Return Value:
2015-08-10 21:07:47 +00:00
* 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
*/
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), []];
if (_loaded isEqualTo []) exitWith {};
2015-08-10 21:07:47 +00:00
{
// TODO Do we want to be able to recover destroyed equipment?
if (_x isEqualType objNull) then {
deleteVehicle _x;
};
2016-01-19 03:53:48 +00:00
nil
} count _loaded;
2015-08-10 21:07:47 +00:00
[_vehicle] call FUNC(validateCargoSpace);