From 759a5eab5d7daf0d3617f60f24bb78ac0ae4377a Mon Sep 17 00:00:00 2001 From: kichikuou Date: Wed, 27 Sep 2023 16:48:16 +0900 Subject: [PATCH] Emscripten: Restart game instead of exiting The same behavior as xsystem35. --- src/sys/nact.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sys/nact.cpp b/src/sys/nact.cpp index 2cb27b8..114226f 100644 --- a/src/sys/nact.cpp +++ b/src/sys/nact.cpp @@ -146,6 +146,10 @@ int NACT::mainloop() void NACT::quit(int code) { +#ifdef __EMSCRIPTEN__ + if (code >= 0) + code = NACT_RESTART; // Restarts the game instead of exiting. +#endif exit_code = code; terminate = true; }