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:
parent
8eb717d4d0
commit
076f13cc01
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user