From b2f40a7a114d543b6a88a8251f995f4be67e6157 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 18:18:46 -0700 Subject: Removed unused assignments. --- src/ChunkMap.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/ChunkMap.cpp') diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index ed9103174..0fb6988b5 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -346,9 +346,8 @@ void cChunkMap::BroadcastAttachEntity(const cEntity & a_Entity, const cEntity * void cChunkMap::BroadcastBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); - int x, y, z, ChunkX, ChunkZ; + int x, z, ChunkX, ChunkZ; x = a_BlockX; - y = a_BlockY; z = a_BlockZ; cChunkDef::BlockToChunk(x, z, ChunkX, ChunkZ); cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ); @@ -1146,9 +1145,8 @@ BLOCKTYPE cChunkMap::GetBlock(int a_BlockX, int a_BlockY, int a_BlockZ) // First check if it isn't queued in the m_FastSetBlockQueue: { int X = a_BlockX, Y = a_BlockY, Z = a_BlockZ; - int ChunkX, ChunkY, ChunkZ; + int ChunkX, ChunkZ; cChunkDef::AbsoluteToRelative(X, Y, Z, ChunkX, ChunkZ); - ChunkY = 0; cCSLock Lock(m_CSFastSetBlock); for (sSetBlockList::iterator itr = m_FastSetBlockQueue.begin(); itr != m_FastSetBlockQueue.end(); ++itr) { -- cgit v1.2.3 From 4c165f8a6ddd40cee7769b622d4b357e1d35c26a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 27 Apr 2014 23:11:21 +0200 Subject: Fixed player spawning #953. --- src/ChunkMap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ChunkMap.cpp') diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 0fb6988b5..537d491c9 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1654,7 +1654,10 @@ void cChunkMap::AddEntity(cEntity * a_Entity) { cCSLock Lock(m_CSLayers); cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ()); - if ((Chunk == NULL) || !Chunk->IsValid()) + if ( + (Chunk == NULL) || // Chunk not present at all + (!Chunk->IsValid() && !a_Entity->IsPlayer()) // Chunk present, but no valid data; players need to spawn in such chunks (#953) + ) { LOGWARNING("Entity at %p (%s, ID %d) spawning in a non-existent chunk, the entity is lost.", a_Entity, a_Entity->GetClass(), a_Entity->GetUniqueID() -- cgit v1.2.3