diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index f528c2d3c0a..965accecc23 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -195,7 +195,7 @@ public: return true; } - static inline bool IsOnlyUser(WorldSession* mySession) + static bool IsOnlyUser(WorldSession* mySession) { // check if there is any session connected from a different address std::string myAddr = mySession ? mySession->GetRemoteAddress() : ""; @@ -381,8 +381,9 @@ private: if (!ParseExitCode(exitCodeStr, exitCode)) return false; + // Override parameter "delay" with the configuration value if there are still players connected and "force" parameter was not specified if (delay < (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD) && !(shutdownMask & SHUTDOWN_MASK_FORCE)) - return false; + delay = (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD); sWorld->ShutdownServ(delay, shutdownMask, static_cast(exitCode), std::string(reason));