Fixing fast click on the pause menu

This commit is contained in:
Zoe Roux
2021-06-18 16:10:11 +02:00
parent 000528ba14
commit 9986166ccc
+4 -2
View File
@@ -73,12 +73,14 @@ namespace BBM
}
if (gameState.nextScene == gameState.currentScene)
return;
if (gameState.nextScene == GameState::SceneID::ScoreScene) {
gameState.loadedScenes[GameState::SceneID::ScoreScene] = Runner::loadScoreScene(*engine.getScene());
if (gameState.previousScene == GameState::SceneID::GameScene) {
for (auto &[_, component]: engine.getScene()->view<ControllableComponent>()) {
component.fastClick = false;
}
}
if (gameState.nextScene == GameState::SceneID::ScoreScene) {
gameState.loadedScenes[GameState::SceneID::ScoreScene] = Runner::loadScoreScene(*engine.getScene());
}
gameState.loadedScenes[gameState.currentScene] = engine.getScene();
engine.changeScene(gameState.loadedScenes[gameState.nextScene]);
gameState.previousScene = gameState.currentScene;