From: darkrose Date: Fri, 10 Aug 2012 02:34:02 +0000 (+1000) Subject: fix node timers so on_timer gets the correct position X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=d05e3adbc7fe912319a14d5c164941017f2c7170;p=zefram%2Fminetest%2Fminetest_engine.git fix node timers so on_timer gets the correct position --- diff --git a/src/environment.cpp b/src/environment.cpp index e3e62106..b88f55de 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)); } }