From 98cb7a19a1a444726eb31af34d4c25cd06c347cb Mon Sep 17 00:00:00 2001 From: kolunmi <113054217+kolunmi@users.noreply.github.com> Date: Thu, 27 Apr 2023 13:17:57 -0700 Subject: [PATCH] ensure distance is greater than 0 in CameraMoveToTarget (#3031) --- src/rcamera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rcamera.h b/src/rcamera.h index 8b37ff7b..852339ab 100644 --- a/src/rcamera.h +++ b/src/rcamera.h @@ -294,7 +294,7 @@ void CameraMoveToTarget(Camera *camera, float delta) distance += delta; // Distance must be greater than 0 - if (distance < 0) distance = 0.001f; + if (distance <= 0) distance = 0.001f; // Set new distance by moving the position along the forward vector Vector3 forward = GetCameraForward(camera);