MCPcopy Create free account
hub / github.com/cuberite/cuberite / ChunkAvailable

Method ChunkAvailable

src/ChunkStay.cpp:106–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106bool 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

Callers 2

SetChunkDataMethod · 0.80
AddChunkStayMethod · 0.80

Calls 3

beginMethod · 0.80
endMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected