Speed improvements

This commit is contained in:
IT07 2016-05-06 13:06:37 +02:00
parent a11636b6bd
commit 371fe792b9
4 changed files with 24 additions and 36 deletions

View File

@ -22,8 +22,6 @@ if (count _pos isEqualTo 3) then
_rad = param [1, -1, [0]]; _rad = param [1, -1, [0]];
if (_rad > -1) then if (_rad > -1) then
{ // Check all player distances from _loc { // Check all player distances from _loc
if (count allPlayers > 0) then
{
{ {
if (isPlayer _x) then if (isPlayer _x) then
{ {
@ -37,6 +35,5 @@ if (count _pos isEqualTo 3) then
} forEach allPlayers; } forEach allPlayers;
}; };
}; };
};
_found _found

View File

@ -40,13 +40,10 @@ if (_this isEqualType []) then
_indexes pushBack _forEachIndex; _indexes pushBack _forEachIndex;
}; };
} forEach _scopes; } forEach _scopes;
if (count _indexes > 0) then
{
{ {
_scopes deleteAt _x; _scopes deleteAt _x;
} forEach _indexes; } forEach _indexes;
}; };
};
_unit addPrimaryWeaponItem (selectRandom _scopes); _unit addPrimaryWeaponItem (selectRandom _scopes);
}; };
if (selectRandom _randomPattern isEqualTo 1) then if (selectRandom _randomPattern isEqualTo 1) then

View File

@ -18,8 +18,6 @@ if (_this isEqualType []) then
private ["_minimum"]; private ["_minimum"];
_minimum = param [0, -1, [0]]; _minimum = param [0, -1, [0]];
if (_minimum > -1) then if (_minimum > -1) then
{
if (count allPlayers >= _minimum) then
{ {
_players = 0; _players = 0;
{ {
@ -28,12 +26,11 @@ if (_this isEqualType []) then
_players = _players + 1; _players = _players + 1;
}; };
} forEach allPlayers; } forEach allPlayers;
if not(_players isEqualTo 0) then if (_players > 0) then
{ {
_ok = true _ok = true
}; };
}; };
}; };
};
_ok _ok

View File

@ -16,12 +16,9 @@ if (([["aiStatic"],["enabled"]] call VEMFr_fnc_getSetting) select 0 isEqualTo 1)
["spawnStaticAI", 2, "launching..."] spawn VEMFr_fnc_log; ["spawnStaticAI", 2, "launching..."] spawn VEMFr_fnc_log;
_settings = [["aiStatic"],["positions","amount"]] call VEMFr_fnc_getSetting; _settings = [["aiStatic"],["positions","amount"]] call VEMFr_fnc_getSetting;
_positions = _settings select 0; _positions = _settings select 0;
if (count _positions > 0) then
{
["spawnStaticAI", 2, "spawning AI on positions..."] spawn VEMFr_fnc_log; ["spawnStaticAI", 2, "spawning AI on positions..."] spawn VEMFr_fnc_log;
_amounts = _settings select 1; _amounts = _settings select 1;
{ {
[_x, 2, _amounts select _foreachindex, "aiMode" call VEMFr_fnc_getSetting, "Static"] spawn VEMFr_fnc_spawnVEMFrAI; [_x, 2, _amounts select _foreachindex, "aiMode" call VEMFr_fnc_getSetting, "Static"] spawn VEMFr_fnc_spawnVEMFrAI;
} forEach _positions; } forEach _positions;
}; };
};