We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Light updates are disabled, because I can not find the bug, thats causing the assert.
In the queue of lightupdates sometimes NULL objects get pushed back (maybe the reason).
void FinishLights() { while (!sunRemovalQueue.empty()) { if (&sunRemovalQueue.front() == nullptr) continue; glm::vec3 pos = sunRemovalQueue.front().first; short val = sunRemovalQueue.front().second; Vector2 c = chunkCoord(pos.x, pos.z); Vector2 b = blockCoord(pos.x, pos.z); sunRemovalQueue.pop(); auto TrySetLightValue = [&](float ox, float oy, float oz) { int neighborLevel = getSunlight(b.x ox, pos.y oy, b.z oz); if (neighborLevel != 0 && neighborLevel < val) resetSunlight(pos.x ox, pos.y oy, pos.z oz); else if (neighborLevel >= val) sunLightQueue.emplace(pos.x ox, pos.y oy, pos.z oz); }; TrySetLightValue(-1, 0, 0); TrySetLightValue( 1, 0, 0); TrySetLightValue( 0, -1, 0); TrySetLightValue( 0, 1, 0); TrySetLightValue( 0, 0, -1); TrySetLightValue( 0, 0, 1); } }
void resetSunlight(int x, int y, int z){ sunRemovalQueue.emplace(glm::vec3(x, y, z), getSunlight(x, y, z)); setSunlight(x, y % CHUNK_SIZE, z, 0); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Light updates are disabled, because I can not find the bug, thats causing the assert.
In the queue of lightupdates sometimes NULL objects get pushed back (maybe the reason).
The text was updated successfully, but these errors were encountered: