From 845d77ebdac40cb0d18389b66e33f6b84577c190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Vigh?= Date: Tue, 27 Apr 2021 16:46:40 +0200 Subject: [PATCH 1/3] area of map is updated in the session at each game preparation to avoid outdated map area and wrong score calculation --- src/Controller/GameController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Controller/GameController.php b/src/Controller/GameController.php index 23cf3c3..aca55b7 100644 --- a/src/Controller/GameController.php +++ b/src/Controller/GameController.php @@ -93,6 +93,11 @@ class GameController 'currentRound' => -1 ]); } + // update the area of the map in the session in any case + else { + $state['area'] = $map->getArea(); + $session->set('state', $state); + } return new JsonContent([ 'mapId' => $mapId, From be0f7b64b8897560721800a7807c4d55fff77010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Vigh?= Date: Tue, 27 Apr 2021 17:35:06 +0200 Subject: [PATCH 2/3] refactored comment --- src/Controller/GameController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Controller/GameController.php b/src/Controller/GameController.php index aca55b7..5fbe09b 100644 --- a/src/Controller/GameController.php +++ b/src/Controller/GameController.php @@ -93,8 +93,7 @@ class GameController 'currentRound' => -1 ]); } - // update the area of the map in the session in any case - else { + else { // update the area of the map in the session in any case $state['area'] = $map->getArea(); $session->set('state', $state); } From 95553296bd57c3d6cbf61a6486b28d07af43d904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Vigh?= Date: Tue, 27 Apr 2021 17:54:47 +0200 Subject: [PATCH 3/3] removed extra line break --- src/Controller/GameController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Controller/GameController.php b/src/Controller/GameController.php index 5fbe09b..ba4b368 100644 --- a/src/Controller/GameController.php +++ b/src/Controller/GameController.php @@ -92,8 +92,7 @@ class GameController 'rounds' => [], 'currentRound' => -1 ]); - } - else { // update the area of the map in the session in any case + } else { // update the area of the map in the session in any case $state['area'] = $map->getArea(); $session->set('state', $state); }