2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-11-09 19:00:18 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2019-06-28 16:50:11 +00:00
|
|
|
* Handles cleaning up blood objects that have reached the end of their lifetime.
|
2016-11-09 19:00:18 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
2019-06-28 16:50:11 +00:00
|
|
|
* Return Value:
|
2016-11-09 19:00:18 +00:00
|
|
|
* None
|
|
|
|
*
|
2019-06-28 16:50:11 +00:00
|
|
|
* Example:
|
|
|
|
* [] call ace_medical_blood_fnc_cleanupLoop
|
|
|
|
*
|
2016-11-09 19:00:18 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
2019-06-28 16:50:11 +00:00
|
|
|
|
2016-11-09 19:00:18 +00:00
|
|
|
(GVAR(bloodDrops) deleteAt 0) params ["", "_deletedBloodDrop"];
|
|
|
|
deleteVehicle _deletedBloodDrop;
|
|
|
|
|
2019-06-28 16:50:11 +00:00
|
|
|
// Exit the loop if we have cleaned out the array
|
2016-11-09 19:00:18 +00:00
|
|
|
if (GVAR(bloodDrops) isEqualTo []) exitWith {};
|
|
|
|
|
|
|
|
// Wait until the next blood drop in the queue will expire
|
|
|
|
(GVAR(bloodDrops) select 0) params ["_expireTime"];
|
2019-06-28 16:50:11 +00:00
|
|
|
[FUNC(cleanupLoop), [], _expireTime - CBA_missionTime] call CBA_fnc_waitAndExecute;
|