From 076f13cc01916ea9942fcadeb1ec40924c8cde8b Mon Sep 17 00:00:00 2001 From: Jürgen Doser Date: Fri, 11 Jan 2013 18:52:00 +0100 Subject: 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. --- src/environment.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/environment.cpp b/src/environment.cpp index 020d2b433..3f94484fe 100644 --- a/src/environment.cpp +++ b/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)); } } -- cgit v1.2.3