From 8273e34eba436763a0cd7d7771ea3dabc00676c5 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Fri, 19 Feb 2021 17:08:44 -0800 Subject: [PATCH] fix a crash introduced with the warning changed. --- src/physac.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/physac.h b/src/physac.h index ec0dc605f..fde0b90e3 100644 --- a/src/physac.h +++ b/src/physac.h @@ -999,13 +999,10 @@ static PhysicsVertexData CreateRectanglePolygon(Vector2 pos, Vector2 size) void UpdatePhysicsStep(void) { // Clear previous generated collisions information - if (physicsManifoldsCount > 0) + for (int i = (int)physicsManifoldsCount - 1; i >= 0; i--) { - for (unsigned int i = physicsManifoldsCount - 1; i >= 0; i--) - { - PhysicsManifold manifold = contacts[i]; - if (manifold != NULL) DestroyPhysicsManifold(manifold); - } + PhysicsManifold manifold = contacts[i]; + if (manifold != NULL) DestroyPhysicsManifold(manifold); } // Reset physics bodies grounded state