mirror of
https://github.com/minetest/minetest.git
synced 2024-08-19 04:54:18 +02:00
players to not be saved when map saving is disabled (due to some error)
This commit is contained in:
parent
14fafc7217
commit
32a29489f3
@ -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);
|
||||
|
||||
// Save players
|
||||
m_env.serializePlayers(m_mapsavedir);
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user