- const Chunk *direct_chunk = this;
- Chunk::Pos direct_pos(pos + Block::FaceNormal(direct_face));
- if (!InBounds(direct_pos)) {
- if (HasNeighbor(direct_face)) {
- direct_chunk = &GetNeighbor(direct_face);
- direct_pos -= (Block::FaceNormal(direct_face) * Extent());
- float direct_light = direct_chunk->GetLight(direct_pos);
- if (direct_light > light) {
- light = direct_light;
- }
- }
- } else {
- float direct_light = direct_chunk->GetLight(direct_pos);
+ // tis okay
+ BlockLookup direct(const_cast<Chunk *>(this), pos, Block::NormalFace(norm));
+ if (direct) {
+ float direct_light = direct.GetLight();