From acfcf2f1d19bd9348eba9f94e8977e2f81923a6a Mon Sep 17 00:00:00 2001 From: Luis <113704180+LuisR385@users.noreply.github.com> Date: Sun, 7 Jun 2026 02:47:57 +0900 Subject: [PATCH] [rmodels] Fix minimum rings validation in DrawCapsule and DrawCapsuleWires (#5909) Ensure rings is at least 1 to prevent rendering issues or crashes when 0 or negative values are passed. --- src/rmodels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 7b4083323..7f140bb6b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -772,7 +772,7 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color) { if (slices < 3) slices = 3; - + if (rings < 1) rings = 1; Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z }; // draw a sphere if start and end points are the same @@ -911,7 +911,7 @@ void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color) { if (slices < 3) slices = 3; - + if (rings < 1) rings = 1; Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z }; // draw a sphere if start and end points are the same