| 104 | |
| 105 | |
| 106 | bool cChunkStay::ChunkAvailable(int a_ChunkX, int a_ChunkZ) |
| 107 | { |
| 108 | // Check if this is a chunk that we want: |
| 109 | bool IsMine = false; |
| 110 | for (cChunkCoordsVector::iterator itr = m_OutstandingChunks.begin(), end = m_OutstandingChunks.end(); itr != end; ++itr) |
| 111 | { |
| 112 | if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkZ == a_ChunkZ)) |
| 113 | { |
| 114 | m_OutstandingChunks.erase(itr); |
| 115 | IsMine = true; |
| 116 | break; |
| 117 | } |
| 118 | } // for itr - m_OutstandingChunks[] |
| 119 | if (!IsMine) |
| 120 | { |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | // Call the appropriate callbacks: |
| 125 | OnChunkAvailable(a_ChunkX, a_ChunkZ); |
| 126 | if (m_OutstandingChunks.empty()) |
| 127 | { |
| 128 | return OnAllChunksAvailable(); |
| 129 | } |
| 130 | return false; |
| 131 | } |
| 132 | |
| 133 | |
| 134 |
no test coverage detected