summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2015-09-02 20:21:55 +0100
committerparamat <mat.gregory@virginmedia.com>2016-02-26 00:50:39 +0000
commit4efb7eb7347bfd712297f5e11d3a055bb74cf597 (patch)
treee3a966c9d1f8c06291190d0fb37af0dbe31bbdf3 /src/environment.cpp
parentf77b35b35bf028f4a4a3d9b40e6524608e46fb0a (diff)
downloadminetest-4efb7eb7347bfd712297f5e11d3a055bb74cf597.tar.gz
minetest-4efb7eb7347bfd712297f5e11d3a055bb74cf597.tar.bz2
minetest-4efb7eb7347bfd712297f5e11d3a055bb74cf597.zip
Cache some settings
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 3bf5e1f0a..081079a79 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -1029,7 +1029,8 @@ void ServerEnvironment::step(float dtime)
// Update this one
// NOTE: This is kind of funny on a singleplayer game, but doesn't
// really matter that much.
- m_recommended_send_interval = g_settings->getFloat("dedicated_server_step");
+ static const float server_step = g_settings->getFloat("dedicated_server_step");
+ m_recommended_send_interval = server_step;
/*
Increment game time
@@ -1086,7 +1087,7 @@ void ServerEnvironment::step(float dtime)
/*
Update list of active blocks, collecting changes
*/
- const s16 active_block_range = g_settings->getS16("active_block_range");
+ static const s16 active_block_range = g_settings->getS16("active_block_range");
std::set<v3s16> blocks_removed;
std::set<v3s16> blocks_added;
m_active_blocks.update(players_blockpos, active_block_range,
@@ -1101,8 +1102,7 @@ void ServerEnvironment::step(float dtime)
for(std::set<v3s16>::iterator
i = blocks_removed.begin();
- i != blocks_removed.end(); ++i)
- {
+ i != blocks_removed.end(); ++i) {
v3s16 p = *i;
/* infostream<<"Server: Block " << PP(p)
@@ -2636,5 +2636,3 @@ ClientEnvEvent ClientEnvironment::getClientEvent()
}
#endif // #ifndef SERVER
-
-