summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gfx.cpp2
-rw-r--r--src/openttd.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index d787dc26f..ff2c80bfc 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -41,7 +41,7 @@ bool _right_button_down; ///< Is right mouse button pressed?
bool _right_button_clicked; ///< Is right mouse button clicked?
DrawPixelInfo _screen;
bool _screen_disable_anim = false; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
-bool _exit_game;
+std::atomic<bool> _exit_game;
GameMode _game_mode;
SwitchMode _switch_mode; ///< The next mainloop command.
PauseMode _pause_mode;
diff --git a/src/openttd.h b/src/openttd.h
index 2cd9cc1f0..6473168ee 100644
--- a/src/openttd.h
+++ b/src/openttd.h
@@ -10,6 +10,7 @@
#ifndef OPENTTD_H
#define OPENTTD_H
+#include <atomic>
#include "core/enum_type.hpp"
/** Mode which defines the state of the game. */
@@ -52,7 +53,7 @@ enum DisplayOptions {
extern GameMode _game_mode;
extern SwitchMode _switch_mode;
-extern bool _exit_game;
+extern std::atomic<bool> _exit_game;
extern bool _save_config;
/** Modes of pausing we've got */