fixed weather code

This commit is contained in:
Marc Zinnschlag 2013-06-28 09:00:21 +02:00
parent 39a12ab9cf
commit cd538538b5

View file

@ -572,11 +572,14 @@ Ogre::String WeatherManager::nextWeather(const ESM::Region* region) const
int chance = (rand() % 100) + 1; // 1..100 int chance = (rand() % 100) + 1; // 1..100
int sum = 0; int sum = 0;
for (int i = 0; i < 10; ++i) int i = 0;
for (; i < 10; ++i)
{ {
sum += probability[i]; sum += probability[i];
if (chance < sum) if (chance < sum)
{ break;
}
switch (i) switch (i)
{ {
case 1: case 1:
@ -601,8 +604,6 @@ Ogre::String WeatherManager::nextWeather(const ESM::Region* region) const
return "clear"; return "clear";
} }
} }
}
}
void WeatherManager::setHour(const float hour) void WeatherManager::setHour(const float hour)
{ {