From 47e11fa3f24d04bd52acd86cd00a2df880314ca0 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 9 Mar 2021 20:30:37 +0100 Subject: [PATCH] Codechange: only run InteractiveRandom() from the draw-thread (#8831) Otherwise both the draw-thread and game-thread can do it both at the same time, which gives rather unwanted side-effects. Calling it from the draw-thread alone is sufficient, as we just want to create some unpredictable randomness for the player. The draw-thread is a lot more active (normally) than the game-thread, so it is the best place of the two to do this. Additionally, InteractiveRandom() mostly has to do with visuals that are client-side-only, so more related to drawing than to game. --- src/openttd.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openttd.cpp b/src/openttd.cpp index 728228209c..3397e4f0e0 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1484,7 +1484,6 @@ void GameLoop() } IncreaseSpriteLRU(); - InteractiveRandom(); /* Check for UDP stuff */ if (_network_available) NetworkBackgroundLoop();