From: sapier Date: Sun, 21 Apr 2013 22:05:47 +0000 (+0200) Subject: fix static data not beeing stored correctly on deactivation X-Git-Tag: 0.4.7~29^2~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58f036ad1d5f1928d3696730ece463ab1acb046e;p=oweals%2Fminetest.git fix static data not beeing stored correctly on deactivation --- diff --git a/src/environment.cpp b/src/environment.cpp index 438c9ef4f..e06b032f2 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1084,8 +1084,8 @@ void ServerEnvironment::step(float dtime) { v3s16 p = *i; - /*infostream<<"Server: Block ("<getBlockNoCreateNoEx(p); if(block==NULL) @@ -1104,9 +1104,6 @@ void ServerEnvironment::step(float dtime) i != blocks_added.end(); ++i) { v3s16 p = *i; - - /*infostream<<"Server: Block ("<getBlockNoCreateNoEx(p); if(block==NULL){ @@ -1117,6 +1114,8 @@ void ServerEnvironment::step(float dtime) } activateBlock(block); + /* infostream<<"Server: Block " << PP(p) + << " became active"<m_static_objects.m_active.find(new_id) != block->m_static_objects.m_active.end()){ + if(id && block->m_static_objects.m_active.find(id) != block->m_static_objects.m_active.end()){ infostream<<"ServerEnv: WARNING: Performing hack #83274" <m_static_objects.remove(new_id); + block->m_static_objects.remove(id); } - block->m_static_objects.insert(new_id, s_obj); + //store static data + block->m_static_objects.insert(0, s_obj); // Only mark block as modified if data changed considerably if(shall_be_written)