1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 14:55:13 -05:00

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.
This commit is contained in:
Jürgen Doser 2013-01-11 18:52:00 +01:00
parent 8eb717d4d0
commit 076f13cc01

View File

@ -804,7 +804,8 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
i = elapsed_timers.begin(); i = elapsed_timers.begin();
i != elapsed_timers.end(); i++){ i != elapsed_timers.end(); i++){
n = block->getNodeNoEx(i->first); 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)); block->setNodeTimer(i->first,NodeTimer(i->second.timeout,0));
} }
} }