From 850b5796b36532c8b6f0e60bc277e86c6e6bf328 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Fri, 7 Nov 2014 21:52:43 +0100 Subject: [PATCH] Speed up removing a node (less block mesh updates). --- src/client.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index c6319d5846e8..89bb053aeac4 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2300,20 +2300,19 @@ void Client::removeNode(v3s16 p) { } - // add urgent task to update the modified node - addUpdateMeshTaskForNode(p, false, true); - for(std::map::iterator i = modified_blocks.begin(); i != modified_blocks.end(); ++i) { - addUpdateMeshTaskWithEdge(i->first); + addUpdateMeshTask(i->first, false, false); } + // add urgent task to update the modified node + addUpdateMeshTaskForNode(p, false, true); } void Client::addNode(v3s16 p, MapNode n, bool remove_metadata) { - TimeTaker timer1("Client::addNode()"); + //TimeTaker timer1("Client::addNode()"); std::map modified_blocks; @@ -2329,7 +2328,7 @@ void Client::addNode(v3s16 p, MapNode n, bool remove_metadata) i = modified_blocks.begin(); i != modified_blocks.end(); ++i) { - addUpdateMeshTaskWithEdge(i->first); + addUpdateMeshTask(i->first, false, false); } }