aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCiaran Gultnieks <ciaran@ciarang.com>2011-05-16 11:34:06 +0100
committerCiaran Gultnieks <ciaran@ciarang.com>2011-05-16 11:34:06 +0100
commit7cdd988f88ae3fc5b1ca342c3c5e176eec0ba8f9 (patch)
tree569d55a5282b2c04888038c56dd1acd6f2a614a3 /src
parent50c48219a7ee6fe11566779f03e5e80361155b3f (diff)
downloadminetest-7cdd988f88ae3fc5b1ca342c3c5e176eec0ba8f9.tar.gz
minetest-7cdd988f88ae3fc5b1ca342c3c5e176eec0ba8f9.tar.bz2
minetest-7cdd988f88ae3fc5b1ca342c3c5e176eec0ba8f9.zip
Better synchronisation of build/mine attempts when the player isn't allowed to
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server.cpp b/src/server.cpp
index f77b4f3c6..338b528e7 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2174,8 +2174,6 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
{
if(datasize < 17)
return;
- if((player->privs & PRIV_BUILD) == 0)
- return;
/*
length: 17
[0] u16 command
@@ -2281,6 +2279,10 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
cannot_remove_node = true;
}
+ // Make sure the player is allowed to do it
+ if((player->privs & PRIV_BUILD) == 0)
+ cannot_remove_node = true;
+
/*
If node can't be removed, set block to be re-sent to
client and quit.
@@ -2427,7 +2429,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
try{
// Don't add a node if this is not a free space
MapNode n2 = m_env.getMap().getNode(p_over);
- if(content_buildable_to(n2.d) == false)
+ if(content_buildable_to(n2.d) == false
+ || (player->privs & PRIV_BUILD) ==0)
{
// Client probably has wrong data.
// Set block not sent, so that client will get