DMS_Exile/@ExileServer/addons/a3_dms/scripts/TargetsKilled.sqf
eraser1 0b0c290495 Function Changes + Fixes + Comments + Logs
Added configurable distance to when cleanup will be aborted for an
object with a player nearby.

Created TargetsKilled function

Rewrite BroadCastMissionStatus (the function was doing the same thing
for each switch case except one, so I just put that in a select
statement)

Created function information for CleanUp.

CleanUp was using "_this" instead of "_x"

Created more/better debug info for CleanUp

Changed calling parameters for FillCrate.

Increased robustness of FillCrate.

Made FillCrate prettier

Created function information for FindSafePos

Created function information for IsPlayerNearByARRAY (deprecated)

Tweaks to MissionStatusCheck:
Created debug log for empty "DMS_Mission_Arr"
Fixed placement of index increase (otherwise deleteAt would remove
incorrect element if it existed)

Created MissionSuccessState

Created logs for RemoveMarkers

Created function information for RemoveMarkers + made it prettier

Created function information for SelectMagazine

Created TargetsKilled
2015-08-28 16:52:56 -05:00

68 lines
1.1 KiB
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
{
if (DMS_DEBUG) then
{
diag_log format ["DMS_DEBUG TargetsKilled :: Converting %1 into ARRAY",_this];
};
_this = [_this];
};
if (_this isEqualTo []) exitWith
{
diag_log "DMS ERROR :: Calling DMS_TargetsKilled with empty array!";
};
private "_killed";
_killed = false;
try
{
{
if (((typeName _x) isEqualTo "OBJECT") && {!isNull _x && {alive _x}}) then
{
throw _x;
}
else
{
if !((typeName _x) isEqualTo "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;