Skip to content
Permalink
Browse files

fixes node timer bug (fixes minetest#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.
  • Loading branch information
doserj committed Jan 11, 2013
1 parent 8eb717d commit 076f13cc01916ea9942fcadeb1ec40924c8cde8b
Showing with 2 additions and 1 deletion.
  1. +2 −1 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));
}
}

0 comments on commit 076f13c

Please sign in to comment.