diff options
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 4abba6359..e70cb39b7 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -43,6 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif #include "daynightratio.h" #include "map.h" +#include "util/serialize.h" #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" @@ -328,7 +329,8 @@ ServerEnvironment::ServerEnvironment(ServerMap *map, lua_State *L, m_send_recommended_timer(0), m_active_block_interval_overload_skip(0), m_game_time(0), - m_game_time_fraction_counter(0) + m_game_time_fraction_counter(0), + m_recommended_send_interval(0.1) { } @@ -939,6 +941,11 @@ void ServerEnvironment::step(float dtime) /* Step time of day */ stepTimeOfDay(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"); + /* Increment game time */ @@ -2296,8 +2303,9 @@ void ClientEnvironment::addActiveObject(u16 id, u8 type, { errorstream<<"ClientEnvironment::addActiveObject():" <<" id="<<id<<" type="<<type - <<": SerializationError in initialize()," - <<" init_data="<<serializeJsonString(init_data) + <<": SerializationError in initialize(): " + <<e.what() + <<": init_data="<<serializeJsonString(init_data) <<std::endl; } @@ -2315,7 +2323,7 @@ void ClientEnvironment::removeActiveObject(u16 id) <<"id="<<id<<" not found"<<std::endl; return; } - obj->removeFromScene(); + obj->removeFromScene(true); delete obj; m_active_objects.remove(id); } |