Skip to content

Commit 076f13c

Browse files
committedJan 11, 2013
fixes node timer bug (fixes luanti-org#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.
1 parent 8eb717d commit 076f13c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/environment.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,8 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
804804
i = elapsed_timers.begin();
805805
i != elapsed_timers.end(); i++){
806806
n = block->getNodeNoEx(i->first);
807-
if(scriptapi_node_on_timer(m_lua,i->first,n,i->second.elapsed))
807+
v3s16 p = i->first + block->getPosRelative();
808+
if(scriptapi_node_on_timer(m_lua,p,n,i->second.elapsed))
808809
block->setNodeTimer(i->first,NodeTimer(i->second.timeout,0));
809810
}
810811
}

0 commit comments

Comments
 (0)
Please sign in to comment.