2015-08-27 07:44:23 +00:00
|
|
|
/*
|
|
|
|
[
|
|
|
|
_position,
|
|
|
|
[_completionType,_completionArgs],
|
|
|
|
[_timeStarted,_timeUntilFail],
|
|
|
|
[_AIUnit1,_AIUnit2,...,_AIUnitX],
|
|
|
|
[
|
|
|
|
[_cleanupObj1,_cleanupObj2,...,_cleanupObjX],
|
|
|
|
[_crate,_vehicle1,_vehicle2,...,_vehicleX]
|
|
|
|
],
|
2015-08-28 08:38:46 +00:00
|
|
|
[_msgWIN,_msgLose],
|
|
|
|
_markers
|
2015-08-27 07:44:23 +00:00
|
|
|
]
|
|
|
|
*/
|
|
|
|
if !(DMS_Mission_Arr isEqualTo []) then {
|
|
|
|
_index = 0;
|
|
|
|
{
|
|
|
|
_index = _index + 1;
|
|
|
|
call {
|
|
|
|
if (DMS_DEBUG) then
|
|
|
|
{
|
|
|
|
diag_log ("DMS :: Checking Mission Status: "+str _x);
|
|
|
|
};
|
|
|
|
_position = _x select 0;
|
2015-08-28 08:38:46 +00:00
|
|
|
_success = (_x select 1) call DMS_MissionSuccessState;
|
2015-08-27 07:44:23 +00:00
|
|
|
_timeStarted = _x select 2 select 0;
|
|
|
|
_timeUntilFail = _x select 2 select 1;
|
|
|
|
_units = _x select 3;
|
|
|
|
_buildings = _x select 4 select 0;
|
|
|
|
_loot = _x select 4 select 1;
|
|
|
|
_msgSuccess = _x select 5 select 0;
|
|
|
|
_msgFail = _x select 5 select 1;
|
2015-08-28 08:38:46 +00:00
|
|
|
_markers = _x select 6;
|
2015-08-27 07:44:23 +00:00
|
|
|
|
|
|
|
if (_success) exitWith {
|
2015-08-28 08:38:46 +00:00
|
|
|
[DMS_CompletedMissionCleanupTime,DMS_CleanUp,(_units+_buildings),false] call ExileServer_system_thread_addTask;
|
2015-08-27 07:44:23 +00:00
|
|
|
_arr = DMS_Mission_Arr deleteAt _index;
|
|
|
|
(_loot select 0) call DMS_FillCrate;
|
|
|
|
_msgSuccess call DMS_BroadcastMissionStatus;
|
2015-08-28 08:38:46 +00:00
|
|
|
[_markers,"win"] call DMS_RemoveMarkers;
|
2015-08-27 07:44:23 +00:00
|
|
|
};
|
|
|
|
|
2015-08-28 08:38:46 +00:00
|
|
|
if (DMS_MissionTimeoutReset && {[_position,DMS_MissionTimeoutResetRange] call ExileServer_util_position_isPlayerNearby}) exitWith
|
2015-08-27 07:44:23 +00:00
|
|
|
{
|
|
|
|
_x set [2,[diag_tickTime,_timeUntilFail]];
|
|
|
|
};
|
|
|
|
|
|
|
|
if ((diag_tickTime-_timeStarted)>_timeUntilFail) exitWith
|
|
|
|
{
|
|
|
|
_arr = DMS_Mission_Arr deleteAt _index;
|
|
|
|
(_units+_buildings+_loot) call DMS_CleanUp;
|
|
|
|
_msgFail call DMS_BroadcastMissionStatus;
|
2015-08-28 08:38:46 +00:00
|
|
|
[_markers,"lose"] call DMS_RemoveMarkers;
|
2015-08-27 07:44:23 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
false;
|
|
|
|
} count DMS_Mission_Arr;
|
|
|
|
};
|