shutdown when requested from lua in singleplayer too
authorest31 <MTest31@outlook.com>
Sat, 26 Dec 2015 15:19:09 +0000 (16:19 +0100)
committerest31 <MTest31@outlook.com>
Mon, 28 Dec 2015 23:40:22 +0000 (00:40 +0100)
Before, minetest.request_shutdown didn't shut down
singleplayer instances or server instances from the server tab.

This commit fixes this. Fixes #3489.

src/game.cpp

index 3f025f6de6b11d3ce2bd728e8de60a0c1d13b4b1..25424fa26c00f2afc389cf2b283fe099598a379d 100644 (file)
@@ -1816,7 +1816,9 @@ void Game::run()
                        && client->checkPrivilege("fast");
 #endif
 
-       while (device->run() && !(*kill || g_gamecallback->shutdown_requested)) {
+       while (device->run()
+                       && !(*kill || g_gamecallback->shutdown_requested
+                       || server->getShutdownRequested())) {
 
                /* Must be called immediately after a device->run() call because it
                 * uses device->getTimer()->getTime()