diff --git a/src/game/game.cpp b/src/game/game.cpp index 79ea932c4e8..fd9bd539c7c 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -365,9 +365,9 @@ void Game::setGameState(GameState_t newState) { g_dispatcher().addTask(std::bind(&Game::shutdown, this), "Game::shutdown"); - #ifdef STATS_ENABLED +#ifdef STATS_ENABLED g_stats.stop(); - #endif +#endif break; } diff --git a/src/lua/scripts/luascript.cpp b/src/lua/scripts/luascript.cpp index 49b09787ae2..7ad680d278c 100644 --- a/src/lua/scripts/luascript.cpp +++ b/src/lua/scripts/luascript.cpp @@ -165,17 +165,15 @@ const std::string &LuaScriptInterface::getFileById(int32_t scriptId) { return it->second; } -const std::string &LuaScriptInterface::getFileByIdForStats(int32_t scriptId) -{ +const std::string &LuaScriptInterface::getFileByIdForStats(int32_t scriptId) { auto it = cacheFiles.find(scriptId); if (it == cacheFiles.end()) { - static const std::string& unk = "(Unknown scriptfile)"; + static const std::string &unk = "(Unknown scriptfile)"; return unk; } return it->second; } - std::string LuaScriptInterface::getStackTrace(const std::string &error_desc) { lua_getglobal(luaState, "debug"); if (!isTable(luaState, -1)) { diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 9fd7b678e6c..b0a7aad643c 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -240,12 +240,12 @@ ProtocolGame::ProtocolGame(Connection_ptr initConnection) : } template -void ProtocolGame::addGameTaskWithStats(Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args) { +void ProtocolGame::addGameTaskWithStats(Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args) { g_dispatcher().addTaskWithStats(std::bind(function, &g_game(), std::forward(args)...), "ProtocolGame::addGameTaskWithStats", function_str, extra_info); } template -void ProtocolGame::addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args) { +void ProtocolGame::addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args) { g_dispatcher().addTaskWithStats(std::bind(function, &g_game(), std::forward(args)...), context, delay, function_str, extra_info); } diff --git a/src/server/network/protocol/protocolgame.hpp b/src/server/network/protocol/protocolgame.hpp index bde932adc5c..93549290548 100644 --- a/src/server/network/protocol/protocolgame.hpp +++ b/src/server/network/protocol/protocolgame.hpp @@ -70,9 +70,9 @@ class ProtocolGame final : public Protocol { private: // Helpers so we don't need to bind every time template - void addGameTaskWithStats(Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args); + void addGameTaskWithStats(Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args); template - void addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args); + void addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args); ProtocolGame_ptr getThis() { return std::static_pointer_cast(shared_from_this());