diff options
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/server.cpp b/src/server.cpp index 920b9aa2d..9bd8e70f3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2545,14 +2545,17 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if(is_valid_dig && n.getContent() != CONTENT_IGNORE) m_script->node_on_dig(p_under, n, playersao); + v3s16 blockpos = getNodeBlockPos(floatToInt(pointed_pos_under, BS)); + RemoteClient *client = getClient(peer_id); // Send unusual result (that is, node not being removed) if(m_env->getMap().getNodeNoEx(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); } + else { + client->ResendBlockIfOnWire(blockpos); + } } } // action == 2 @@ -2594,15 +2597,21 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) // If item has node placement prediction, always send the // blocks to make sure the client knows what exactly happened - if(item.getDefinition(m_itemdef).node_placement_prediction != ""){ - RemoteClient *client = getClient(peer_id); - v3s16 blockpos = getNodeBlockPos(floatToInt(pointed_pos_above, BS)); + RemoteClient *client = getClient(peer_id); + v3s16 blockpos = getNodeBlockPos(floatToInt(pointed_pos_above, BS)); + v3s16 blockpos2 = getNodeBlockPos(floatToInt(pointed_pos_under, BS)); + if(item.getDefinition(m_itemdef).node_placement_prediction != "") { client->SetBlockNotSent(blockpos); - v3s16 blockpos2 = getNodeBlockPos(floatToInt(pointed_pos_under, BS)); - if(blockpos2 != blockpos){ + if(blockpos2 != blockpos) { client->SetBlockNotSent(blockpos2); } } + else { + client->ResendBlockIfOnWire(blockpos); + if(blockpos2 != blockpos) { + client->ResendBlockIfOnWire(blockpos2); + } + } } // action == 3 /* |