1
0
Fork 0

Fixed a possible crash in cWorld::WakeUpSimulatorsInArea().

The Y coords weren't checked.
This commit is contained in:
madmaxoft 2014-02-23 16:30:49 +01:00
parent f8586b8e9d
commit 728e3c68b6
1 changed files with 4 additions and 0 deletions

View File

@ -805,6 +805,10 @@ void cChunkMap::WakeUpSimulators(int a_BlockX, int a_BlockY, int a_BlockZ)
/// Wakes up the simulators for the specified area of blocks
void cChunkMap::WakeUpSimulatorsInArea(int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ)
{
// Limit the Y coords:
a_MinBlockY = std::max(a_MinBlockY, 0);
a_MaxBlockY = std::min(a_MaxBlockY, cChunkDef::Height - 1);
cSimulatorManager * SimMgr = m_World->GetSimulatorManager();
int MinChunkX, MinChunkZ, MaxChunkX, MaxChunkZ;
cChunkDef::BlockToChunk(a_MinBlockX, a_MinBlockZ, MinChunkX, MinChunkZ);