mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
fixed weather code
This commit is contained in:
parent
39a12ab9cf
commit
cd538538b5
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user