From 32ddbca34cde7c751190bb7998e8160b4ca9502d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 8 Sep 2018 11:11:43 +0200 Subject: [PATCH] Fix steps --- raycastlib.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index f4c7c3a..f5e7fe8 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -1006,9 +1006,6 @@ void moveCameraWithCollision(Camera *camera, Vector2D planeOffset, int16_t xSquare = divRoundDown(corner.x,UNITS_PER_SQUARE); int16_t ySquare = divRoundDown(corner.y,UNITS_PER_SQUARE); - int8_t isOnGround = camera->height - CAMERA_COLL_HEIGHT_BELOW - - floorHeightFunc(xSquareNew,ySquareNew) < 2; - cornerNew.x = corner.x + planeOffset.x; cornerNew.y = corner.y + planeOffset.y; @@ -1016,7 +1013,7 @@ void moveCameraWithCollision(Camera *camera, Vector2D planeOffset, ySquareNew = divRoundDown(cornerNew.y,UNITS_PER_SQUARE); Unit bottomLimit = camera->height - CAMERA_COLL_HEIGHT_BELOW + - (isOnGround ? CAMERA_COLL_STEP_HEIGHT : 0); + CAMERA_COLL_STEP_HEIGHT; Unit topLimit = camera->height + CAMERA_COLL_HEIGHT_ABOVE; // checks a single square for collision against the camera -- 2.11.4.GIT