Send proper block to old clients for swap_node calls
authorest31 <MTest31@outlook.com>
Thu, 17 Sep 2015 18:08:11 +0000 (20:08 +0200)
committerest31 <MTest31@outlook.com>
Thu, 17 Sep 2015 18:23:31 +0000 (20:23 +0200)
The legacy code added in commit

d879a539cd19ddd1ee34afec2512fb2238de2822 - "Add minetest.swap_node"

for sending the whole mapblock to older clients on the case of a node
modification with swap_node, had the problem that the block chosen to be
sent to the client was referenced with node coordinates and not with
block coordinates, resulting in getting the wrong block sent to the client.

src/server.cpp

index 646e8465bf54b9b977c2db7fdf470d61c1bbd08c..9a5739892dcbb4dd087cbd3e679a313048f541b3 100644 (file)
@@ -2102,7 +2102,7 @@ void Server::sendAddNode(v3s16 p, MapNode n, u16 ignore_id,
                                if (client->net_proto_version <= 21) {
                                        // Old clients always clear metadata; fix it
                                        // by sending the full block again.
-                                       client->SetBlockNotSent(p);
+                                       client->SetBlockNotSent(getNodeBlockPos(p));
                                }
                        }
                }