Do not use screen fading during game loading if there is no current cell (bug #5211)

pull/556/head
Andrei Kortunov 5 years ago
parent 980e0c4936
commit 73f43ba750

@ -175,6 +175,7 @@
Bug #5206: A "class does not have NPC stats" error when player's follower kills an enemy with damage spell Bug #5206: A "class does not have NPC stats" error when player's follower kills an enemy with damage spell
Bug #5209: Spellcasting ignores race height Bug #5209: Spellcasting ignores race height
Bug #5210: AiActivate allows actors to open dialogue and inventory windows Bug #5210: AiActivate allows actors to open dialogue and inventory windows
Bug #5211: Screen fades in if the first loaded save is in interior cell
Feature #1774: Handle AvoidNode Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI
Feature #3025: Analogue gamepad movement controls Feature #3025: Analogue gamepad movement controls

@ -683,11 +683,9 @@ namespace MWWorld
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent) void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent)
{ {
CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName); CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
bool loadcell = (mCurrentCell == nullptr); bool useFading = (mCurrentCell != nullptr);
if(!loadcell) if (useFading)
loadcell = *mCurrentCell != *cell; MWBase::Environment::get().getWindowManager()->fadeScreenOut(0.5);
MWBase::Environment::get().getWindowManager()->fadeScreenOut(0.5);
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
int messagesCount = MWBase::Environment::get().getWindowManager()->getMessagesCount(); int messagesCount = MWBase::Environment::get().getWindowManager()->getMessagesCount();
@ -695,7 +693,7 @@ namespace MWWorld
loadingListener->setLabel(loadingInteriorText, false, messagesCount > 0); loadingListener->setLabel(loadingInteriorText, false, messagesCount > 0);
Loading::ScopedLoad load(loadingListener); Loading::ScopedLoad load(loadingListener);
if(!loadcell) if(mCurrentCell != nullptr && *mCurrentCell == *cell)
{ {
MWBase::World *world = MWBase::Environment::get().getWorld(); MWBase::World *world = MWBase::Environment::get().getWorld();
world->moveObject(world->getPlayerPtr(), position.pos[0], position.pos[1], position.pos[2]); world->moveObject(world->getPlayerPtr(), position.pos[0], position.pos[1], position.pos[2]);
@ -734,7 +732,8 @@ namespace MWWorld
if (changeEvent) if (changeEvent)
mCellChanged = true; mCellChanged = true;
MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.5); if (useFading)
MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.5);
MWBase::Environment::get().getWindowManager()->changeCell(mCurrentCell); MWBase::Environment::get().getWindowManager()->changeCell(mCurrentCell);
} }

Loading…
Cancel
Save