Fix score creation on Game

This commit is contained in:
Ruben 2016-09-04 00:00:08 +01:00
parent 37a14f567b
commit a7f0415eb4

View file

@ -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;
}