From a7f0415eb459eccd5b0e52ba68df709e058d4fae Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 4 Sep 2016 00:00:08 +0100 Subject: [PATCH] Fix score creation on Game --- src/Api/ScoreControllerProvider.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Api/ScoreControllerProvider.php b/src/Api/ScoreControllerProvider.php index b205c0c..2c0457a 100644 --- a/src/Api/ScoreControllerProvider.php +++ b/src/Api/ScoreControllerProvider.php @@ -75,8 +75,6 @@ class ScoreControllerProvider implements ControllerProviderInterface return new JsonResponse(['success' => false, 'message' => "Invalid target for hit"], 400); } - // set game appends hit to game - $hit->setGame($game); $hit->setTarget($target); $hit->setScore($data_hit['score']); @@ -101,6 +99,10 @@ class ScoreControllerProvider implements ControllerProviderInterface $hit->setPoint($i, $data_hit['points']["$i"]['x'], $data_hit['points']["$i"]['y']); } + + // set game appends hit to game + $hit->setGame($game); + $map_hits[$data_hit['id']] = $hit; }