I haven't COMPLETELY forgotten about this...

This commit is contained in:
eraser1 2018-02-13 00:07:34 -06:00
parent bf28a02056
commit 06a13b1e32
14 changed files with 30 additions and 75 deletions

View File

@ -112,15 +112,7 @@ try
throw format["_missionObjs |%1|",_missionObjs];
};
private _mines =
if ((count _missionObjs)>3) then
{
_missionObjs param [3,[],[[]]]
}
else
{
[]
};
private _mines = _missionObjs param [3,[],[[]]];
// Don't spawn a minefield if there is one already defined in _missionObjs.
if (DMS_SpawnMinefieldForEveryMission && {_mines isEqualTo []}) then
@ -153,7 +145,7 @@ try
])
then
{
throw format["_onEndingScripts |%1|",_onEndingScripts];
//throw format["_onEndingScripts |%1|",_onEndingScripts];
};
private _unitCount = count (_units call DMS_fnc_GetAllUnits);

View File

@ -123,7 +123,7 @@ try
throw format["_missionObjs |%1|",_missionObjs];
};
private _mines = if ((count _missionObjs)>3) then { _missionObjs param [3,[],[[]]] } else { [] };
private _mines = _missionObjs param [3,[],[[]]];
// Don't spawn a minefield if there is one already defined in _missionObjs.
if (DMS_SpawnMinefieldForEveryMission && {_mines isEqualTo []}) then
@ -155,7 +155,7 @@ try
])
then
{
throw format["_onEndingScripts |%1|",_onEndingScripts];
//throw format["_onEndingScripts |%1|",_onEndingScripts];
};
private _unitCount = count (_units call DMS_fnc_GetAllUnits);

View File

@ -258,7 +258,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
if ([_posOrObj,_radius] call DMS_fnc_IsPlayerNearby) then
{
private _maxAICount = if ((count _monitorParams)>3) then {_monitorParams param [3, 0, [0]]} else {0};
private _maxAICount = _monitorParams param [3, 0, [0]];
_unitsToSpawn = _reinforcementCount min ((_maxAICount-_remainingUnits) max 0);
};
@ -299,7 +299,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
if (_remainingUnits<_AICount) then
{
private _maxAICount = if ((count _monitorParams)>2) then {_monitorParams param [2, 0, [0]]} else {_AICount};
private _maxAICount = _monitorParams param [2, _AICount, [0]];
_unitsToSpawn = _reinforcementCount min ((_maxAICount-_remainingUnits) max 0);
};
@ -322,7 +322,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
if (_remainingUnits<_AICount) then
{
private _maxAICount = if ((count _monitorParams)>3) then {_monitorParams param [3, 0, [0]]} else {_AICount};
private _maxAICount = _monitorParams param [3, _AICount, [0]];
_unitsToSpawn = _reinforcementCount min ((_maxAICount-_remainingUnits) max 0);
@ -355,7 +355,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
case "hardcore": {"hardcore"};
};
private _maxAICount = if ((count _monitorParams)>3) then {_monitorParams param [3, 0, [0]]} else {_AICount};
private _maxAICount = _monitorParams param [3, _AICount, [0]];
_unitsToSpawn = _reinforcementCount min ((_maxAICount-_remainingUnits) max 0);
};
@ -375,7 +375,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
if (_remainingUnits<_AICount) then
{
private _vehClass = if ((count _monitorParams)>1) then {_monitorParams param [1, "", [""]]} else {"random"};
private _vehClass = _monitorParams param [1, "random", [""]];
private _leaderPos = getPosATL (leader _AIGroup);
@ -419,7 +419,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
{
deleteVehicle _vehicle;
private _vehClass = if ((count _monitorParams)>1) then {_monitorParams param [1, "", [""]]} else {"random"};
private _vehClass = _monitorParams param [1, "random", [""]];
private _leaderPos = getPosATL (leader _AIGroup);
@ -466,7 +466,7 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
{
deleteVehicle _staticGun;
private _staticGunClass = if ((count _monitorParams)>1) then {_monitorParams param [1, "", [""]]} else {"random"};
private _staticGunClass = _monitorParams param [1, "random", [""]];
private _leaderPos = getPosATL (leader _AIGroup);
@ -512,8 +512,8 @@ if (!_reinforcementsDepleted && {(diag_tickTime-_lastUpdated)>_updateDelay}) the
if (_remainingUnits<_AICount) then
{
private _dropPoint = if ((count _monitorParams)>4) then {_monitorParams param [4, getPosATL (leader _AIGroup), [objNull,[]], [2,3]]} else {getPosATL (leader _AIGroup)};
private _heliClass = if ((count _monitorParams)>5) then {_monitorParams param [5, "", [""]]} else {selectRandom DMS_ReinforcementHelis};
private _dropPoint = _monitorParams param [4, getPosATL (leader _AIGroup), [objNull,[]], [2,3]];
private _heliClass = _monitorParams param [5, selectRandom DMS_ReinforcementHelis, [""]];
private _params =
[

View File

@ -36,7 +36,7 @@ private _exit = false;
};
private _absoluteWinCondition = if ((count _x)>2) then {_x select 2} else {false};
private _absoluteWinCondition = _x param [2, false, [true]];
if (!_success && {!_absoluteWinCondition}) then
{

View File

@ -49,7 +49,7 @@ catch
if (_exit) exitWith {false};
private _behavior = if ((count _this)>3) then {_this select 3;} else {"COMBAT"};
private _behavior = param [3, "COMBAT", [""]];
_group setCombatMode "RED";

View File

@ -34,7 +34,7 @@ then
diag_log format ["DMS ERROR :: Calling DMS_fnc_SetGroupBehavior_Separate with invalid params: %1",_this];
};
private _behavior = if ((count _this)>3) then {_this select 3;} else {"COMBAT"};
private _behavior = param [3, "COMBAT", [""]];
private _tmpGroup = createGroup (side _finalGroup);

View File

@ -34,15 +34,7 @@ exitWith
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnAIStaticMG with invalid parameters: %1",_this];
};
private _MGClassInput =
if ((count _this)>5) then
{
_this select 5
}
else
{
"random"
};
private _MGClassInput = param [5, "random", [""]];
private _guns = _positions apply

View File

@ -34,15 +34,7 @@ exitWith
_spawnPos = _positions select 0;
private _vehClass =
if ((count _this)>5) then
{
param [5,"random",[""]]
}
else
{
"random"
};
private _vehClass = param [5, "random", [""]];
if (_vehClass == "random") then
{

View File

@ -27,7 +27,7 @@ if (_missionCode isEqualTo "no") then
}
else
{
private _parameters = if ((count _this)>1) then {_this select 1} else {[]};
private _parameters = _this param [1,[]];
DMS_MissionCount = DMS_MissionCount + 1;
DMS_RunningBMissionCount = DMS_RunningBMissionCount + 1;

View File

@ -29,7 +29,7 @@ if !(isClass (configFile >> "CfgVehicles" >> _crateClassName)) exitWith
objNull
};
private _spawnATL = if ((count _this)>2) then {_this select 2} else {true};
private _spawnATL = param [2, true, [true]];
private _crate = createVehicle [_crateClassName,_pos,[], 0, "CAN_COLLIDE"];

View File

@ -44,7 +44,7 @@ if (isNull _AIGroup) exitWith
-1
};
private _heliClass = if ((count _this)>8) then {_this param [8, "", [""]]} else {selectRandom DMS_ReinforcementHelis};
private _heliClass = param [8, selectRandom DMS_ReinforcementHelis, [""]];
// Make the AI group local to add passengers.
if !(local _AIGroup) then

View File

@ -27,17 +27,8 @@ if (DMS_SpawnMinesAroundMissions) then
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnMinefield with invalid parameters: %1",_this];
};
_spawnWarningSign = DMS_SpawnMineWarningSigns;
_mineClassname = "ATMine";
if ((count _this)>3) then
{
_spawnWarningSign = param [3,DMS_SpawnMineWarningSigns,[true]];
if ((count _this)>4) then
{
_mineClassname = param [4,"ATMine",[true]];
};
};
private _spawnWarningSign = param [3,DMS_SpawnMineWarningSigns,[true]];
private _mineClassname = param [4,"ATMine",[true]];
if !(getText (configfile >> "CfgVehicles" >> _mineClassname >> "vehicleClass") isEqualTo "Mines") exitWith

View File

@ -76,7 +76,7 @@ try
throw (format ["invalid STRING _pinCode value (must be 4 digits): %1",_pinCode]);
};
private _spawnATL = if ((count _this)>3) then {_this select 3} else {true};
private _spawnATL = param [3, true, [true]];
// Create and set the vehicle
_vehObj = [_vehicleClass,_pos] call DMS_fnc_SpawnNonPersistentVehicle;

View File

@ -37,25 +37,12 @@ try
};
private _parameters = if ((count _this)>1) then {_this select 1} else {[]};
DMS_MissionCount = DMS_MissionCount + 1;
private _parameters = param [1, []];
private _return = _parameters call _mission;
if ((!isNil "_return") && {_return isEqualTo "delay"}) then
{
DMS_MissionCount = DMS_MissionCount - 1;
if (DMS_SpawnMissions_Scheduled) then
{
[60, DMS_fnc_SpawnStaticMission, [_missionType], false] call ExileServer_system_thread_addTask;
}
else
{
[60, {[_this, DMS_fnc_SpawnStaticMission] execFSM "exile_server\fsm\call.fsm";}, [_missionType], false] call ExileServer_system_thread_addTask;
};
if (DMS_DEBUG) then
{
(format ["SpawnStaticMission :: Mission ""%1"" requested delay",_missionType]) call DMS_fnc_DebugLog;
@ -63,6 +50,7 @@ try
}
else
{
DMS_MissionCount = DMS_MissionCount + 1;
DMS_StaticMissionDelay = DMS_TimeBetweenStaticMissions call DMS_fnc_SelectRandomVal;
DMS_StaticMissionLastStart = diag_tickTime;
DMS_RunningStaticMissions pushBack _missionType;