From 83bb6f28d58847959fbaa7c8607e66dcc898ebf9 Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Sun, 31 Jan 2021 18:40:33 +0100 Subject: [PATCH] game: fix order of updating that causes crashes --- src/strategy_roles/game.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/strategy_roles/game.cpp b/src/strategy_roles/game.cpp index 42aa7bf..92b4517 100644 --- a/src/strategy_roles/game.cpp +++ b/src/strategy_roles/game.cpp @@ -10,12 +10,13 @@ Game::Game(LineSystem* ls_, PositionSystem* ps_) { void Game::play(bool condition){ if(condition) { + + CURRENT_DATA_WRITE.game = this; + CURRENT_DATA_WRITE.posSystem = (this->ps); + CURRENT_DATA_WRITE.lineSystem = (this->ls); + ps->update(); realPlay(); ls->update(); - - CURRENT_DATA_WRITE.posSystem = (this->ps); - CURRENT_DATA_WRITE.lineSystem = (this->ls); - CURRENT_DATA_WRITE.game = this; } } \ No newline at end of file