mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
a4144c7c07
FSM should now call all of the functions... Fixed debug messages for selectmission Added recursive call for cleanup for typeName ARRAY arguments Fixed parsing for FillCrate Fixed script errors and removed some RPT spam from missionsmonitor Allow groups for missionsuccesstate Removed debug log for converting data type into array for TargetsKilled
63 lines
957 B
Plaintext
63 lines
957 B
Plaintext
/*
|
|
DMS_TargetsKilled
|
|
Created by eraser1
|
|
|
|
Usage:
|
|
[
|
|
_unit,
|
|
_group,
|
|
_object
|
|
] call DMS_TargetsKilled;
|
|
|
|
Will accept non-array argument of group, unit, or object.
|
|
*/
|
|
|
|
if ((typeName _this) in ["GROUP","OBJECT"]) then
|
|
{
|
|
_this = [_this];
|
|
};
|
|
|
|
if (_this isEqualTo []) exitWith
|
|
{
|
|
diag_log "DMS ERROR :: Calling DMS_TargetsKilled with empty array!";
|
|
};
|
|
|
|
private "_killed";
|
|
|
|
_killed = false;
|
|
|
|
try
|
|
{
|
|
{
|
|
if (((typeName _x) == "OBJECT") && {!isNull _x && {alive _x}}) then
|
|
{
|
|
throw _x;
|
|
}
|
|
else
|
|
{
|
|
if !((typeName _x) == "GROUP") exitWith
|
|
{
|
|
diag_log format ["DMS ERROR :: %1 is neither OBJECT nor GROUP!",_x];
|
|
};
|
|
{
|
|
if (!isNull _x && {alive _x}) exitWith
|
|
{
|
|
throw _x;
|
|
};
|
|
false;
|
|
} count (units _x);
|
|
};
|
|
|
|
false;
|
|
} count _this;
|
|
|
|
_killed = true;
|
|
}
|
|
catch
|
|
{
|
|
if (DMS_DEBUG) then {
|
|
diag_log format ["DMS_DEBUG TargetsKilled :: %1 is still alive! All of %2 are not yet killed!",_exception,_this];
|
|
};
|
|
};
|
|
|
|
_killed; |