aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-14 11:10:44 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-14 11:10:44 +0200
commit32a29489f3ecbff1fa2b72b91c699695b489be8c (patch)
tree21c4f17ce09aeac731bd28fb3b5589e10e26d212
parent14fafc72177fdc77bf8c8955363c77719f74e33b (diff)
downloadminetest-32a29489f3ecbff1fa2b72b91c699695b489be8c.tar.gz
minetest-32a29489f3ecbff1fa2b72b91c699695b489be8c.tar.bz2
minetest-32a29489f3ecbff1fa2b72b91c699695b489be8c.zip
players to not be saved when map saving is disabled (due to some error)
-rw-r--r--src/server.cpp27
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);
+ }
}
}
}