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 sum = 0;
for (int i = 0; i < 10; ++i)
int i = 0;
for (; i < 10; ++i)
{
sum += probability[i];
if (chance < sum)
{
break;
}
switch (i)
{
case 1:
@ -600,8 +603,6 @@ Ogre::String WeatherManager::nextWeather(const ESM::Region* region) const
default: // case 0
return "clear";
}
}
}
}
void WeatherManager::setHour(const float hour)