From ad209bcb7a93925757efd4aa5a4cb8d95dc4df49 Mon Sep 17 00:00:00 2001 From: Vsevolod Kremianskii Date: Sun, 15 Nov 2020 11:18:28 +0700 Subject: [PATCH] fix: Stop player and camera movement when opening party selection --- src/game/game.cpp | 8 +++++++- src/game/game.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 604fe38c..d3d09e10 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -540,12 +540,17 @@ void Game::openInGameMenu(InGameMenu::Tab tab) { } void Game::startDialog(SpatialObject &owner, const string &resRef) { - _module->player().stopMovement(); + stopMovement(); setCursorType(CursorType::Default); _screen = GameScreen::Dialog; _dialog->startDialog(owner, resRef); } +void Game::stopMovement() { + getActiveCamera()->stopMovement(); + _module->player().stopMovement(); +} + void Game::openContainer(SpatialObject *container) { setCursorType(CursorType::Default); _container->open(container); @@ -553,6 +558,7 @@ void Game::openContainer(SpatialObject *container) { } void Game::openPartySelection(const PartySelection::Context &ctx) { + stopMovement(); setCursorType(CursorType::Default); _partySelect->prepare(ctx); _screen = GameScreen::PartySelection; diff --git a/src/game/game.h b/src/game/game.h index 1cf7de6f..e97cf434 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -227,6 +227,7 @@ private: void runMainLoop(); void toggleInGameCameraType(); void updateCamera(float dt); + void stopMovement(); std::string getMainMenuMusic() const; std::string getCharacterGenerationMusic() const;