Skip to content

Commit

Permalink
fixes node timer bug (fixes minetest#407).
Browse files Browse the repository at this point in the history
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 076f13c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/environment.cpp
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 076f13c

Please sign in to comment.