mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 10:39:39 +00:00
Make changeWeather work when the player isn't in a cell yet (workaround for modTESTchargen_v2_5)
This commit is contained in:
parent
4b27950879
commit
002b41ba51
1 changed files with 7 additions and 3 deletions
|
@ -702,9 +702,13 @@ void WeatherManager::changeWeather(const std::string& region, const unsigned int
|
||||||
|
|
||||||
mRegionOverrides[Misc::StringUtils::lowerCase(region)] = weather;
|
mRegionOverrides[Misc::StringUtils::lowerCase(region)] = weather;
|
||||||
|
|
||||||
std::string playerRegion = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell()->getCell()->mRegion;
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if (Misc::StringUtils::ciEqual(region, playerRegion))
|
if (player.isInCell())
|
||||||
setWeather(weather);
|
{
|
||||||
|
std::string playerRegion = player.getCell()->getCell()->mRegion;
|
||||||
|
if (Misc::StringUtils::ciEqual(region, playerRegion))
|
||||||
|
setWeather(weather);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WeatherManager::modRegion(const std::string ®ionid, const std::vector<char> &chances)
|
void WeatherManager::modRegion(const std::string ®ionid, const std::vector<char> &chances)
|
||||||
|
|
Loading…
Reference in a new issue