From 8083ca97d15458af4b07c63cbf80b5b5a74afb1d Mon Sep 17 00:00:00 2001 From: kakukri Date: Mon, 30 Nov 2015 00:20:46 +0000 Subject: [PATCH] Re #924: make tCarelt->priv->dashboardActiveItem copy between threads git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6294 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: f68e60a67298f0ceace12035f6aa39b953b2516c Former-commit-id: 1f942f24691617d41137d2a76525c2179e58b660 --- src/modules/racing/standardgame/racesituation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/racing/standardgame/racesituation.cpp b/src/modules/racing/standardgame/racesituation.cpp index dddde938..ecff7468 100644 --- a/src/modules/racing/standardgame/racesituation.cpp +++ b/src/modules/racing/standardgame/racesituation.cpp @@ -821,6 +821,13 @@ tRmInfo* ReSituationUpdater::copySituation(tRmInfo*& pTarget, const tRmInfo* pSo //pTgtCar->_debug = pSrcCar->_debug; // Ever used anywhere ? pTgtCar->priv.collision_state = pSrcCar->priv.collision_state; //pTgtCar->_memoryPool ...; // ???? Memory pool copy ?????? + pTgtCar->_dashboardActiveItem = pSrcCar->_dashboardActiveItem; + /* NOTE: dashboardInstant, dashboardInstantNb, dashboardRequest, dashboardRequestNb + * are not copied, because they are initialized once and never changed again. + * An dashboardInstant and dashboardRequest's tCarSetupItem pointers + * are not updated, so they always point to the targets setup field. + * This is safe until the graphics engine does not start to change car setups. + */ // 5) ctrl (raw mem copy) memcpy(&pTgtCar->ctrl, &pSrcCar->ctrl, sizeof(tCarCtrl));