From 376e0a2eb41602755f189639fe375dc308669577 Mon Sep 17 00:00:00 2001 From: Luis Date: Sat, 6 Jun 2026 01:43:57 +0900 Subject: [PATCH] [rmodels] Fix minimum rings validation in DrawCapsule and DrawCapsuleWires 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 32ade139f..b5a42d1f8 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