Replace forEach with Count

Use count where you do not need _forEachIndex variable, it's quicker
than forEach.
This commit is contained in:
icomrade
2014-05-27 15:37:57 -04:00
parent 91d246e64e
commit e54b9983dd
210 changed files with 890 additions and 890 deletions

View File

@@ -20,7 +20,7 @@ _numWeatherOptions = count _weatherOptions;
// get inital weather forcast for the next 5 minutes
_forcastTime = 300;
if (isNil "WeatherForcast" and isNil "WeatherForcastTime") then {
if (isNil "WeatherForcast" && isNil "WeatherForcastTime") then {
WeatherForcast = floor(random(_numWeatherOptions));
WeatherForcastTime = diag_tickTime;
} else {
@@ -40,7 +40,7 @@ if (isNil "CurrentWeatherOption") then {
CurrentWeatherOption = ((CurrentWeatherOption + 1) min _numWeatherOptions);
} else {
// start transition down if forcast is lower in the array than current weather
if (CurrentWeatherOption != WeatherForcast and WeatherForcastTime >= _forcastTime) then {
if (CurrentWeatherOption != WeatherForcast && WeatherForcastTime >= _forcastTime) then {
CurrentWeatherOption = ((CurrentWeatherOption - 1) max 0) ;
};
};