diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-12-10 00:03:55 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2024-12-10 00:03:55 +0100 |
commit | 99d87ea638f71b53b08b8028c9952f75c06b69cf (patch) | |
tree | 4b13af9bf66602c8b568a4c5b8b93d6b4b7a3a6e /src/server/scripts/Commands | |
parent | c81183a6600722f3a9bb4996c0849b530fbdd1b0 (diff) |
Core/Commands: Fix vmap directory size calculation for .server debug command after 518fe1fd1ecf107e11336c4a41ed90405b115dc0
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r-- | src/server/scripts/Commands/cs_server.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index c58f038677a..c9221d3ff90 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -204,12 +204,12 @@ public: continue; } - auto end = boost::filesystem::directory_iterator(); - std::size_t folderSize = std::accumulate(boost::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, boost::filesystem::path const& mapFile) + auto end = boost::filesystem::recursive_directory_iterator(); + std::size_t folderSize = std::accumulate(boost::filesystem::recursive_directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, boost::filesystem::directory_entry const& mapFile) { boost::system::error_code ec; - if (boost::filesystem::is_regular_file(mapFile, ec)) - val += boost::filesystem::file_size(mapFile); + if (mapFile.is_regular_file(ec) && !ec) + val += boost::filesystem::file_size(mapFile.path(), ec); return val; }); |