mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Cracking blocks while digging
This commit is contained in:
parent
d5a78c1253
commit
3b0bff2f74
16 changed files with 232 additions and 289 deletions
|
@ -1321,13 +1321,23 @@ void Server::AsyncRunStep()
|
|||
{
|
||||
float &counter = m_savemap_timer;
|
||||
counter += dtime;
|
||||
if(counter >= SERVER_MAP_SAVE_INTERVAL)
|
||||
if(counter >= g_settings.getFloat("server_map_save_interval"))
|
||||
{
|
||||
counter = 0.0;
|
||||
|
||||
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)
|
||||
{
|
||||
dout_server<<"Server: Unloaded "<<deleted_count
|
||||
<<" sectors from memory"<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue