fix node timers so on_timer gets the correct position

This commit is contained in:
darkrose 2012-08-10 12:34:02 +10:00 committed by Perttu Ahola
parent a9a475ad50
commit d05e3adbc7

@ -1087,7 +1087,8 @@ void ServerEnvironment::step(float 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)) 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));
} }
} }