game: fix order of updating that causes crashes

pull/1/head
EmaMaker 2021-01-31 18:40:33 +01:00
parent 46a76a340c
commit 83bb6f28d5
1 changed files with 5 additions and 4 deletions

View File

@ -10,12 +10,13 @@ Game::Game(LineSystem* ls_, PositionSystem* ps_) {
void Game::play(bool condition){ void Game::play(bool condition){
if(condition) { if(condition) {
CURRENT_DATA_WRITE.game = this;
CURRENT_DATA_WRITE.posSystem = (this->ps);
CURRENT_DATA_WRITE.lineSystem = (this->ls);
ps->update(); ps->update();
realPlay(); realPlay();
ls->update(); ls->update();
CURRENT_DATA_WRITE.posSystem = (this->ps);
CURRENT_DATA_WRITE.lineSystem = (this->ls);
CURRENT_DATA_WRITE.game = this;
} }
} }