summaryrefslogtreecommitdiffstats
path: root/labb4/mainwindow.cpp
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-11-10 15:33:46 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-11-10 15:33:46 +0100
commit6f5cb7a9babdf57f5eae54fb468773857f48ecdd (patch)
tree2b2c27e5ec90dde99956d065400fc39fd7324f4e /labb4/mainwindow.cpp
parentc3028edebab1d021d2d95a26beea3ccd58a4e28f (diff)
downloadtddd86-6f5cb7a9babdf57f5eae54fb468773857f48ecdd.tar.gz
copy assignment return when this == &other
Diffstat (limited to 'labb4/mainwindow.cpp')
-rw-r--r--labb4/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/labb4/mainwindow.cpp b/labb4/mainwindow.cpp
index 6fd4422..31ceff2 100644
--- a/labb4/mainwindow.cpp
+++ b/labb4/mainwindow.cpp
@@ -153,9 +153,11 @@ bool MainWindow::tryMove(Hero hero, const Point& point) {
* Process results of viable move
*/
void MainWindow::processMove(bool waiting) {
- GameState copy=gameState;
+ GameState copy = gameState;
copy.moveRobots();
- gameState=copy;
+ gameState = copy;
+
+ gameState = gameState;
score += gameState.countCollisions() * (POINTS_PER_ROBOT +
(waiting ? WAIT_BONUS : 0));