aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkrose <lisa@ltmnet.com>2012-08-10 12:34:02 +1000
committerPerttu Ahola <celeron55@gmail.com>2012-08-12 15:28:31 +0300
commitd05e3adbc7fe912319a14d5c164941017f2c7170 (patch)
tree1bf36560d9b27d9de3319b53092079864281ef6e
parenta9a475ad50ae93c253e0d1eda1f71a42dbc20298 (diff)
downloadminetest-d05e3adbc7fe912319a14d5c164941017f2c7170.tar.gz
minetest-d05e3adbc7fe912319a14d5c164941017f2c7170.tar.bz2
minetest-d05e3adbc7fe912319a14d5c164941017f2c7170.zip
fix node timers so on_timer gets the correct position
-rw-r--r--src/environment.cpp3
1 files changed, 2 insertions, 1 deletions
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));
}
}