From: Jürgen Doser Date: Fri, 11 Jan 2013 17:52:00 +0000 (+0100) Subject: fixes node timer bug (fixes #407). X-Git-Tag: 0.4.5~104 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=076f13cc01916ea9942fcadeb1ec40924c8cde8b;p=oweals%2Fminetest.git fixes node timer bug (fixes #407). Previously, when a block was activated, on_timer callbacks where called with the relative position of the node inside the block, instead of the absolute position of the node. --- diff --git a/src/environment.cpp b/src/environment.cpp index 020d2b433..3f94484fe 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -804,7 +804,8 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime) i = elapsed_timers.begin(); i != elapsed_timers.end(); i++){ n = block->getNodeNoEx(i->first); - if(scriptapi_node_on_timer(m_lua,i->first,n,i->second.elapsed)) + v3s16 p = i->first + block->getPosRelative(); + if(scriptapi_node_on_timer(m_lua,p,n,i->second.elapsed)) block->setNodeTimer(i->first,NodeTimer(i->second.timeout,0)); } }