From d05e3adbc7fe912319a14d5c164941017f2c7170 Mon Sep 17 00:00:00 2001 From: darkrose Date: Fri, 10 Aug 2012 12:34:02 +1000 Subject: fix node timers so on_timer gets the correct position --- src/environment.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/environment.cpp') diff --git a/src/environment.cpp b/src/environment.cpp index e3e621065..b88f55dea 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1087,7 +1087,8 @@ void ServerEnvironment::step(float 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)) + 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