diff options
author | Mattes D <github@xoft.cz> | 2015-05-09 11:16:56 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-05-09 12:58:55 +0200 |
commit | 846d16315a8b5a81fbc37d66da4d1254038ec494 (patch) | |
tree | 2a7c873756a3063480a64a975491bd58d9538554 /src/Chunk.cpp | |
parent | More style checking. (diff) | |
download | cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.tar cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.tar.gz cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.tar.bz2 cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.tar.lz cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.tar.xz cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.tar.zst cuberite-846d16315a8b5a81fbc37d66da4d1254038ec494.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index bed5aa991..ed5a1b12a 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -472,26 +472,26 @@ void cChunk::Stay(bool a_Stay) -void cChunk::CollectMobCensus(cMobCensus& toFill) +void cChunk::CollectMobCensus(cMobCensus & toFill) { toFill.CollectSpawnableChunk(*this); - std::list<const Vector3d*> playerPositions; - cPlayer* currentPlayer; - for (cClientHandleList::iterator itr = m_LoadedByClient.begin(), end = m_LoadedByClient.end(); itr != end; ++itr) + std::list<const Vector3d *> playerPositions; + cPlayer * currentPlayer; + for (auto itr = m_LoadedByClient.begin(), end = m_LoadedByClient.end(); itr != end; ++itr) { currentPlayer = (*itr)->GetPlayer(); playerPositions.push_back(&(currentPlayer->GetPosition())); } Vector3d currentPosition; - for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr) + for (auto itr = m_Entities.begin(); itr != m_Entities.end(); ++itr) { // LOGD("Counting entity #%i (%s)", (*itr)->GetUniqueID(), (*itr)->GetClass()); if ((*itr)->IsMob()) { - cMonster& Monster = (cMonster&)(**itr); + auto & Monster = reinterpret_cast<cMonster &>(**itr); currentPosition = Monster.GetPosition(); - for (std::list<const Vector3d*>::const_iterator itr2 = playerPositions.begin(); itr2 != playerPositions.end(); ++itr2) + for (auto itr2 = playerPositions.cbegin(); itr2 != playerPositions.cend(); ++itr2) { toFill.CollectMob(Monster, *this, (currentPosition - **itr2).SqrLength()); } @@ -531,7 +531,7 @@ void cChunk::GetRandomBlockCoords(int & a_X, int & a_Y, int & a_Z) -void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner) +void cChunk::SpawnMobs(cMobSpawner & a_MobSpawner) { int CenterX, CenterY, CenterZ; GetRandomBlockCoords(CenterX, CenterY, CenterZ); @@ -1839,7 +1839,7 @@ bool cChunk::SetSignLines(int a_PosX, int a_PosY, int a_PosZ, const AString & a_ -void cChunk::RemoveBlockEntity( cBlockEntity* a_BlockEntity) +void cChunk::RemoveBlockEntity(cBlockEntity * a_BlockEntity) { MarkDirty(); m_BlockEntities.remove(a_BlockEntity); |