diff --git a/src/sys/nact.cpp b/src/sys/nact.cpp index 114226f..7474ef5 100644 --- a/src/sys/nact.cpp +++ b/src/sys/nact.cpp @@ -147,8 +147,7 @@ int NACT::mainloop() void NACT::quit(int code) { #ifdef __EMSCRIPTEN__ - if (code >= 0) - code = NACT_RESTART; // Restarts the game instead of exiting. + code = EM_ASM_INT({ return xsystem35.shell.onExit($0); }, code); #endif exit_code = code; terminate = true;