summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorkolunmi <[email protected]>2023-04-27 13:17:57 -0700
committerGitHub <[email protected]>2023-04-27 22:17:57 +0200
commit98cb7a19a1a444726eb31af34d4c25cd06c347cb (patch)
tree9cb0175b79a3b4df36cb68eefd2cb982b3e166bf /src
parente2996f167ede62b38cc280a46a8dceb6b5bcd01e (diff)
downloadraylib-98cb7a19a1a444726eb31af34d4c25cd06c347cb.tar.gz
raylib-98cb7a19a1a444726eb31af34d4c25cd06c347cb.zip
ensure distance is greater than 0 in CameraMoveToTarget (#3031)
Diffstat (limited to 'src')
-rw-r--r--src/rcamera.h2
1 files changed, 1 insertions, 1 deletions
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);