1
0

WakeUpSimulators correct Y computation

+ Add Y validity check to SimulatorManager
This commit is contained in:
Tiger Wang
2020-08-05 08:35:10 +01:00
parent c0d1cffe0b
commit d2156aab7c
2 changed files with 12 additions and 7 deletions

View File

@@ -71,8 +71,12 @@ void cSimulatorManager::WakeUp(cChunk & a_Chunk, Vector3i a_Position)
for (const auto Offset : cSimulator::AdjacentOffsets)
{
auto Relative = a_Position + Offset;
auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(Relative);
if (!cChunkDef::IsValidHeight(Relative.y))
{
continue;
}
auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(Relative);
if ((Chunk == nullptr) || !Chunk->IsValid())
{
continue;