forked from mirror/openmw-tes3mp
fixed weather code
This commit is contained in:
parent
39a12ab9cf
commit
cd538538b5
1 changed files with 27 additions and 26 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue