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,20 +22,17 @@ 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 if (speed _x < 250) then // Ignore fast moving players
{ {
if (speed _x < 250) then // Ignore fast moving players private ["_isClose"];
{ _isClose = if ((position _x distance _pos) < _rad) then { true } else { false };
private ["_isClose"]; if _isClose then { _found = true };
_isClose = if ((position _x distance _pos) < _rad) then { true } else { false };
if _isClose then { _found = true };
};
}; };
} forEach allPlayers; };
}; } forEach allPlayers;
}; };
}; };

View File

@ -40,12 +40,9 @@ 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);
}; };

View File

@ -19,19 +19,16 @@ if (_this isEqualType []) then
_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; if (isPlayer _x) then
{ {
if (isPlayer _x) then _players = _players + 1;
{
_players = _players + 1;
};
} forEach allPlayers;
if not(_players isEqualTo 0) then
{
_ok = true
}; };
} forEach allPlayers;
if (_players > 0) then
{
_ok = true
}; };
}; };
}; };

View File

@ -13,15 +13,12 @@
if (([["aiStatic"],["enabled"]] call VEMFr_fnc_getSetting) select 0 isEqualTo 1) then if (([["aiStatic"],["enabled"]] call VEMFr_fnc_getSetting) select 0 isEqualTo 1) then
{ {
["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;
{ _amounts = _settings select 1;
["spawnStaticAI", 2, "spawning AI on positions..."] spawn VEMFr_fnc_log; {
_amounts = _settings select 1; [_x, 2, _amounts select _foreachindex, "aiMode" call VEMFr_fnc_getSetting, "Static"] spawn VEMFr_fnc_spawnVEMFrAI;
{ } forEach _positions;
[_x, 2, _amounts select _foreachindex, "aiMode" call VEMFr_fnc_getSetting, "Static"] spawn VEMFr_fnc_spawnVEMFrAI;
} forEach _positions;
};
}; };