mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
Only call InteractiveRandom when game state mutex is held
This commit is contained in:
parent
e094b7f1d6
commit
70897c3e5e
@ -136,10 +136,6 @@ void VideoDriver::Tick()
|
|||||||
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
|
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
|
||||||
if (this->next_draw_tick < now - ALLOWED_DRIFT * this->GetDrawInterval()) this->next_draw_tick = now;
|
if (this->next_draw_tick < now - ALLOWED_DRIFT * this->GetDrawInterval()) this->next_draw_tick = now;
|
||||||
|
|
||||||
/* Keep the interactive randomizer a bit more random by requesting
|
|
||||||
* new values when-ever we can. */
|
|
||||||
InteractiveRandom();
|
|
||||||
|
|
||||||
this->InputLoop();
|
this->InputLoop();
|
||||||
|
|
||||||
/* Check if the fast-forward button is still pressed. */
|
/* Check if the fast-forward button is still pressed. */
|
||||||
@ -156,6 +152,10 @@ void VideoDriver::Tick()
|
|||||||
std::lock_guard<std::mutex> lock_wait(this->game_thread_wait_mutex);
|
std::lock_guard<std::mutex> lock_wait(this->game_thread_wait_mutex);
|
||||||
std::lock_guard<std::mutex> lock_state(this->game_state_mutex);
|
std::lock_guard<std::mutex> lock_state(this->game_state_mutex);
|
||||||
|
|
||||||
|
/* Keep the interactive randomizer a bit more random by requesting
|
||||||
|
* new values when-ever we can. */
|
||||||
|
InteractiveRandom();
|
||||||
|
|
||||||
this->LockVideoBuffer();
|
this->LockVideoBuffer();
|
||||||
|
|
||||||
if (this->change_blitter != nullptr) {
|
if (this->change_blitter != nullptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user