From c7aa992790ec3eb85d78272252d78d37d70c4bc3 Mon Sep 17 00:00:00 2001 From: Niko Jochim <82joni1bif@hft-stuttgart.de> Date: Fri, 26 Jun 2020 02:55:02 +0200 Subject: [PATCH] FIX pauseGame Modal in GameEnd View --- GoldWars/GoldWars/Scenes/GameScene.swift | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index c19dd10..8991eea 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -336,16 +336,18 @@ class GameScene: SKScene{ @objc func pauseGame() -> Void { - entityManager.removeModal() - entityManager.getHUD()?.roundTimer.stopTimer() - entityManager.add(Modal(modaltype: .PauseGame, - base: nil, - anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), - gameScene: self, - currentDraggedBase: nil, - touchLocation: nil, - collisionBase: nil - )) + if !GameCenterManager.sharedInstance.gameEnded { + entityManager.removeModal() + entityManager.getHUD()?.roundTimer.stopTimer() + entityManager.add(Modal(modaltype: .PauseGame, + base: nil, + anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), + gameScene: self, + currentDraggedBase: nil, + touchLocation: nil, + collisionBase: nil + )) + } } @objc func resumeGame() -> Void {