aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-21 11:15:15 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:49 +0200
commit0ce0c8fcfba655c8db5f53ce8e3ab7adfa59768a (patch)
tree7491e7b68e0cd4c43a19de54b7352d4d9e0de778 /src/server.cpp
parent811ac5ac3ae6de6ee152f724aaf392ac73c3ed40 (diff)
downloadminetest-0ce0c8fcfba655c8db5f53ce8e3ab7adfa59768a.tar.gz
minetest-0ce0c8fcfba655c8db5f53ce8e3ab7adfa59768a.tar.bz2
minetest-0ce0c8fcfba655c8db5f53ce8e3ab7adfa59768a.zip
Improve LuaEntity velocity/acceleration handling (by kahrl); implement staticdata interface to Lua
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 467153031..ad80851dd 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2501,6 +2501,32 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
NOTE: This can be used in the future to check if
somebody is cheating, by checking the timing.
*/
+ bool cannot_punch_node = false;
+
+ MapNode n(CONTENT_IGNORE);
+
+ try
+ {
+ n = m_env->getMap().getNode(p_under);
+ }
+ catch(InvalidPositionException &e)
+ {
+ infostream<<"Server: Not punching: Node not found."
+ <<" Adding block to emerge queue."
+ <<std::endl;
+ m_emerge_queue.addBlock(peer_id,
+ getNodeBlockPos(p_over), BLOCK_EMERGE_FLAG_FROMDISK);
+ cannot_punch_node = true;
+ }
+
+ if(cannot_punch_node)
+ return;
+
+ /*
+ Run script hook
+ */
+ scriptapi_environment_on_punchnode(m_lua, p_under, n);
+
} // action == 0
/*