mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
f65f6e9b72
Allows cargo objects to be added via classname and reduces simulation/synchronization overhead. Objects become physical upon unloading and cannot be re-made virtual, only scripts can add such virtual objects. Also separates the player feedback from the loading/unloading code and adds a progress bar.
33 lines
575 B
Plaintext
33 lines
575 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 (_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);
|