Merge branch 'master' into jgrpp
# Conflicts: # .gitignore # CMakeLists.txt # src/3rdparty/optional/optional.hpp # src/group_cmd.cpp # src/industry_cmd.cpp # src/misc_gui.cpp # src/video/sdl2_v.cpp
This commit is contained in:
@@ -87,6 +87,11 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
# include <emscripten.h>
|
||||
# include <emscripten/html5.h>
|
||||
#endif
|
||||
|
||||
void CallLandscapeTick();
|
||||
void IncreaseDate();
|
||||
void MusicLoop();
|
||||
@@ -123,6 +128,15 @@ void CDECL usererror(const char *s, ...)
|
||||
ShowOSErrorBox(buf, false);
|
||||
if (VideoDriver::GetInstance() != nullptr) VideoDriver::GetInstance()->Stop();
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_exit_pointerlock();
|
||||
/* In effect, the game ends here. As emscripten_set_main_loop() caused
|
||||
* the stack to be unwound, the code after MainLoop() in
|
||||
* openttd_main() is never executed. */
|
||||
EM_ASM(if (window["openttd_syncfs"]) openttd_syncfs());
|
||||
EM_ASM(if (window["openttd_abort"]) openttd_abort());
|
||||
#endif
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user