forked from teamnwah/openmw-tes3coop
fixed weather code
This commit is contained in:
parent
39a12ab9cf
commit
cd538538b5
1 changed files with 27 additions and 26 deletions
|
@ -572,35 +572,36 @@ 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)
|
}
|
||||||
{
|
|
||||||
case 1:
|
switch (i)
|
||||||
return "cloudy";
|
{
|
||||||
case 2:
|
case 1:
|
||||||
return "foggy";
|
return "cloudy";
|
||||||
case 3:
|
case 2:
|
||||||
return "overcast";
|
return "foggy";
|
||||||
case 4:
|
case 3:
|
||||||
return "rain";
|
return "overcast";
|
||||||
case 5:
|
case 4:
|
||||||
return "thunderstorm";
|
return "rain";
|
||||||
case 6:
|
case 5:
|
||||||
return "ashstorm";
|
return "thunderstorm";
|
||||||
case 7:
|
case 6:
|
||||||
return "blight";
|
return "ashstorm";
|
||||||
case 8:
|
case 7:
|
||||||
return "snow";
|
return "blight";
|
||||||
case 9:
|
case 8:
|
||||||
return "blizzard";
|
return "snow";
|
||||||
default: // case 0
|
case 9:
|
||||||
return "clear";
|
return "blizzard";
|
||||||
}
|
default: // case 0
|
||||||
}
|
return "clear";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue