mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Merge remote-tracking branch 'lgro/issue417_apply_weather_instantly_when_teleporting'
This commit is contained in:
commit
1f4c192bf6
@ -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 != "")
|
||||||
@ -683,17 +694,8 @@ bool WeatherManager::isDark() 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)
|
||||||
@ -720,4 +722,5 @@ void WeatherManager::switchToNextWeather(bool instantly)
|
|||||||
|
|
||||||
setWeather(weatherType, instantly);
|
setWeather(weatherType, instantly);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user