mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01: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:
parent
8eb717d4d0
commit
076f13cc01
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user