From e3be6b1a47d07c1c86c51e75329bc850ede8809c Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Wed, 28 Dec 2011 02:38:00 +0000 Subject: =?UTF-8?q?Little=20improvement=20to=20save=20some=20cpu=20time=20?= =?UTF-8?q?but=20it=C2=B4s=20still=20very=20heavy=20cpu=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://mc-server.googlecode.com/svn/trunk@141 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cSandSimulator.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/cSandSimulator.cpp') diff --git a/source/cSandSimulator.cpp b/source/cSandSimulator.cpp index b25b498c5..77f206b52 100644 --- a/source/cSandSimulator.cpp +++ b/source/cSandSimulator.cpp @@ -51,6 +51,9 @@ bool cSandSimulator::IsAllowedBlock( char a_BlockID ) void cSandSimulator::AddBlock(int a_X, int a_Y, int a_Z) { + if(!IsAllowedBlock(m_World->GetBlock(a_X, a_Y, a_Z))) //This should save very much time because it doesn´t have to iterate through all blocks + return; + Vector3i *Block = new Vector3i(a_X, a_Y, a_Z); //check for duplicates -- cgit v1.2.3