forked from mirror/openmw-tes3mp
Correction to the e9844e1
commit.
Restored interrior check in WeatherManager::update(). Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
This commit is contained in:
parent
101813fd0d
commit
722469d57b
1 changed files with 32 additions and 29 deletions
|
@ -324,6 +324,17 @@ void WeatherManager::update(float duration)
|
||||||
|
|
||||||
mWeatherUpdateTime -= timePassed;
|
mWeatherUpdateTime -= timePassed;
|
||||||
|
|
||||||
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||||
|
const bool exterior = (world->isCellExterior() || world->isCellQuasiExterior());
|
||||||
|
if (!exterior)
|
||||||
|
{
|
||||||
|
mRendering->sunDisable(false);
|
||||||
|
mRendering->skyDisable();
|
||||||
|
mRendering->getSkyManager()->setLightningStrength(0.f);
|
||||||
|
stopSounds(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switchToNextWeather(false);
|
switchToNextWeather(false);
|
||||||
|
|
||||||
if (mNextWeather != "")
|
if (mNextWeather != "")
|
||||||
|
@ -676,17 +687,8 @@ float WeatherManager::getWindSpeed() const
|
||||||
void WeatherManager::switchToNextWeather(bool instantly)
|
void WeatherManager::switchToNextWeather(bool instantly)
|
||||||
{
|
{
|
||||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||||
const bool exterior = (world->isCellExterior() || world->isCellQuasiExterior());
|
if (world->isCellExterior() || world->isCellQuasiExterior())
|
||||||
if (!exterior)
|
|
||||||
{
|
{
|
||||||
mRendering->sunDisable(false);
|
|
||||||
mRendering->skyDisable();
|
|
||||||
mRendering->getSkyManager()->setLightningStrength(0.f);
|
|
||||||
stopSounds(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exterior
|
|
||||||
std::string regionstr = Misc::StringUtils::lowerCase(world->getPlayer().getPlayer().getCell()->mCell->mRegion);
|
std::string regionstr = Misc::StringUtils::lowerCase(world->getPlayer().getPlayer().getCell()->mCell->mRegion);
|
||||||
|
|
||||||
if (mWeatherUpdateTime <= 0 || regionstr != mCurrentRegion)
|
if (mWeatherUpdateTime <= 0 || regionstr != mCurrentRegion)
|
||||||
|
@ -714,3 +716,4 @@ void WeatherManager::switchToNextWeather(bool instantly)
|
||||||
setWeather(weatherType, instantly);
|
setWeather(weatherType, instantly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue