diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-30 15:11:58 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-30 15:11:58 +0200 |
commit | bb44d25d60fa4719e42e27ff163c194fa3c9fb00 (patch) | |
tree | b2e3e98ab399654f7900bde1acc7c48ab94f56b8 /source/cChunk.cpp | |
parent | Farmland is created using a hoe on dirt or grass. (diff) | |
download | cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.tar cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.tar.gz cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.tar.bz2 cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.tar.lz cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.tar.xz cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.tar.zst cuberite-bb44d25d60fa4719e42e27ff163c194fa3c9fb00.zip |
Diffstat (limited to 'source/cChunk.cpp')
-rw-r--r-- | source/cChunk.cpp | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp index ff8badc19..32b6f1664 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -259,36 +259,14 @@ void cChunk::SetAllData( CalculateHeightmap();
}
- // Clear the internal entities:
- for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr)
- {
- if ((*itr)->GetEntityType() == cEntity::eEntityType_Player)
- {
- // Move players into the new entity list
- a_Entities.push_back(*itr);
- }
- else
- {
- // Delete other entities (there should not be any, since we're now loading / generating the chunk)
- LOGWARNING("cChunk: There is an unexpected entity #%d of type %s in chunk [%d, %d]; it will be deleted",
- (*itr)->GetUniqueID(), (*itr)->GetClass(),
- m_PosX, m_PosZ
- );
-
- // MD 2012_03_10: This may happen if a mob is generated near the edge of loaded chunks and walks off of the edge.
- // Older: Assert because this is a very curious case. These lines were executed once before, when a player died, re spawned, and walked around a bit. It's uncertain why an entity would be in the chunk in this case.
- // ASSERT(!"Unexpected entity in chunk!");
-
- (*itr)->Destroy();
- }
- }
+ // Append entities to current entity list:
+ m_Entities.splice(m_Entities.end(), a_Entities);
+
+ // Clear the block entities present - either the loader / saver has better, or we'll create empty ones:
for (cBlockEntityList::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)
{
delete *itr;
}
-
- // Swap the entity lists:
- std::swap(a_Entities, m_Entities);
std::swap(a_BlockEntities, m_BlockEntities);
// Create block entities that the loader didn't load; fill them with defaults
|