diff options
-rw-r--r-- | src/server.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/server.cpp b/src/server.cpp index f2078b9d0..739698f16 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1395,20 +1395,23 @@ void Server::AsyncRunStep() JMutexAutoLock lock(m_env_mutex); - // Save only changed parts - m_env.getMap().save(true); - - // Delete unused sectors - u32 deleted_count = m_env.getMap().deleteUnusedSectors( - g_settings.getFloat("server_unload_unused_sectors_timeout")); - if(deleted_count > 0) + if(((ServerMap*)(&m_env.getMap()))->isSavingEnabled() == true) { - dout_server<<"Server: Unloaded "<<deleted_count - <<" sectors from memory"<<std::endl; - } + // Save only changed parts + m_env.getMap().save(true); + + // Delete unused sectors + u32 deleted_count = m_env.getMap().deleteUnusedSectors( + g_settings.getFloat("server_unload_unused_sectors_timeout")); + if(deleted_count > 0) + { + dout_server<<"Server: Unloaded "<<deleted_count + <<" sectors from memory"<<std::endl; + } - // Save players - m_env.serializePlayers(m_mapsavedir); + // Save players + m_env.serializePlayers(m_mapsavedir); + } } } } |