From: Perttu Ahola Date: Mon, 9 Apr 2012 18:13:22 +0000 (+0300) Subject: Make client know about reverted disallowed diggings X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=f8c2f1cf54c3328abf994d146858b47029c98b3d;p=zefram%2Fminetest%2Fminetest_engine.git Make client know about reverted disallowed diggings --- diff --git a/src/server.cpp b/src/server.cpp index d7b55a46..389f6282 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2955,8 +2955,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) */ if(!checkPriv(player->getName(), "interact")) { - infostream<<"Ignoring interaction from player "<getName() - <<" (no interact privilege)"<getName()<<" attempted to interact with " + <SetBlockNotSent(blockpos); return; } @@ -3041,6 +3046,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } if(n.getContent() != CONTENT_IGNORE) scriptapi_node_on_dig(m_lua, p_under, n, playersao); + + if (m_env->getMap().getNode(p_under).getContent() != CONTENT_AIR) + { + // Re-send block to revert change on client-side + RemoteClient *client = getClient(peer_id); + v3s16 blockpos = getNodeBlockPos(floatToInt(pointed_pos_under, BS)); + client->SetBlockNotSent(blockpos); + } } } // action == 2