X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fenvironment.cpp;h=e70cb39b784d42a38a6e93f118e408a9e3c3e5f9;hb=ab45133ab4826359ca9a5ed50b68150eb462c8ef;hp=4abba63599f4f3a1157a99677d2dca56260e53f4;hpb=9cadaf824b3a59c85ad03f9c7185f43724b8e7ff;p=oweals%2Fminetest.git 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="<removeFromScene(); + obj->removeFromScene(true); delete obj; m_active_objects.remove(id); }