Wakes up the simulators for the specified area of blocks
| 804 | |
| 805 | /// Wakes up the simulators for the specified area of blocks |
| 806 | void cChunkMap::WakeUpSimulatorsInArea(int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ) |
| 807 | { |
| 808 | // Limit the Y coords: |
| 809 | a_MinBlockY = std::max(a_MinBlockY, 0); |
| 810 | a_MaxBlockY = std::min(a_MaxBlockY, cChunkDef::Height - 1); |
| 811 | |
| 812 | cSimulatorManager * SimMgr = m_World->GetSimulatorManager(); |
| 813 | int MinChunkX, MinChunkZ, MaxChunkX, MaxChunkZ; |
| 814 | cChunkDef::BlockToChunk(a_MinBlockX, a_MinBlockZ, MinChunkX, MinChunkZ); |
| 815 | cChunkDef::BlockToChunk(a_MaxBlockX, a_MaxBlockZ, MaxChunkX, MaxChunkZ); |
| 816 | for (int z = MinChunkZ; z <= MaxChunkZ; z++) |
| 817 | { |
| 818 | int MinZ = std::max(a_MinBlockZ, z * cChunkDef::Width); |
| 819 | int MaxZ = std::min(a_MaxBlockZ, z * cChunkDef::Width + cChunkDef::Width - 1); |
| 820 | for (int x = MinChunkX; x <= MaxChunkX; x++) |
| 821 | { |
| 822 | cChunkPtr Chunk = GetChunkNoGen(x, 0, z); |
| 823 | if ((Chunk == NULL) || !Chunk->IsValid()) |
| 824 | { |
| 825 | continue; |
| 826 | } |
| 827 | int MinX = std::max(a_MinBlockX, x * cChunkDef::Width); |
| 828 | int MaxX = std::min(a_MaxBlockX, x * cChunkDef::Width + cChunkDef::Width - 1); |
| 829 | for (int BlockY = a_MinBlockY; BlockY <= a_MaxBlockY; BlockY++) |
| 830 | { |
| 831 | for (int BlockZ = MinZ; BlockZ <= MaxZ; BlockZ++) |
| 832 | { |
| 833 | for (int BlockX = MinX; BlockX <= MaxX; BlockX++) |
| 834 | { |
| 835 | SimMgr->WakeUp(BlockX, BlockY, BlockZ, Chunk); |
| 836 | } // for BlockX |
| 837 | } // for BlockZ |
| 838 | } // for BlockY |
| 839 | } // for x - chunks |
| 840 | } // for z = chunks |
| 841 | } |
| 842 | |
| 843 | |
| 844 |
nothing calls this directly
no test coverage detected