Fix fog incorrectly still applying with a non-full size block, even though camera wasn't actually inside the block (thanks Goodly)

This commit is contained in:
UnknownShadow200 2019-07-22 07:34:17 +10:00
parent 4342482610
commit cf5671394a

View File

@ -54,7 +54,7 @@ static void EnvRenderer_CalcFog(float* density, PackedCol* col) {
Vec3_Add(&blockBB.Min, &pos, &Blocks.MinBB[block]);
Vec3_Add(&blockBB.Max, &pos, &Blocks.MaxBB[block]);
if (AABB_ContainsPoint(&blockBB, &pos) && Blocks.FogDensity[block] != 0.0f) {
if (AABB_ContainsPoint(&blockBB, &Camera.CurrentPos) && Blocks.FogDensity[block]) {
*density = Blocks.FogDensity[block];
*col = Blocks.FogCol[block];
} else {