From 300eceb005d5a3a690a9ba597238cc31511b7197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Tue, 25 Sep 2018 08:06:49 +0200 Subject: [PATCH] Fix door roll --- raycastlib.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index 1844adf..022cef0 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -1400,9 +1400,11 @@ void _RCL_columnFunctionSimple(RCL_HitResult *hits, uint16_t hitCount, { // normal hit, check the door roll + RCL_Unit texCoordMod = hit.textureCoord % RCL_UNITS_PER_SQUARE; + int8_t unrolled = hit.doorRoll >= 0 ? - hit.doorRoll > hit.textureCoord : - hit.textureCoord > RCL_UNITS_PER_SQUARE + hit.doorRoll; + hit.doorRoll > texCoordMod : + texCoordMod > RCL_UNITS_PER_SQUARE + hit.doorRoll; if (unrolled) {