From 9af5ed43fd7f85c3b2813485d0a37a559589d694 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 31 Dec 2011 21:08:23 +0000 Subject: Made a couple of functions in cChunk inline, this should speed up several block operations on chunks Players should not spawn in the ground anymore. When an entity was added to cWorld twice (which shouldn't happen actually), the server would crash when the entity is destroyed, this should be fixed now. git-svn-id: http://mc-server.googlecode.com/svn/trunk@158 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/cWorld.cpp') diff --git a/source/cWorld.cpp b/source/cWorld.cpp index 501f78332..0b1ee7010 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -415,8 +415,8 @@ void cWorld::Tick(float a_Dt) { LOG("Destroy that entity! %i", (*itr)->GetUniqueID() ); cEntity* RemoveMe = *itr; - itr++; - AddToRemoveEntityQueue( *RemoveMe ); + itr = m_pState->AllEntities.erase( itr ); + m_pState->RemoveEntityQueue.push_back( RemoveMe ); continue; } (*itr)->Tick(a_Dt); -- cgit v1.2.3