From 5ddee98e70c2ad37e43cd93165084e1ccc31f6f2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 30 Jul 2016 13:19:02 +0200 Subject: [PATCH] - fixed: Voxels with scaled to 0 caused a division by zero crash. --- src/r_things.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/r_things.cpp b/src/r_things.cpp index 78d72fbc8..248e50c18 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -2751,6 +2751,11 @@ void R_DrawVoxel(const FVector3 &globalpos, FAngle viewangle, // Also do some magic voodoo scaling to make them the right size. daxscale = daxscale / (0xC000 >> 6); dayscale = dayscale / (0xC000 >> 6); + if (daxscale <= 0 || dayscale <= 0) + { + // won't be visible. + return; + } angle_t viewang = viewangle.BAMs(); cosang = FLOAT2FIXED(viewangle.Cos()) >> 2;