From 1b3ce64c16431492d5df5bdcf2f276dcf06e472d Mon Sep 17 00:00:00 2001 From: Alan Millard Date: Tue, 17 Nov 2020 21:43:54 +0000 Subject: [PATCH] Fixes bug in cpSpaceShapeQuery. Previously, the anyCollision flag would sometimes get cleared erroneously after a collision had already been detected. --- src/cpSpaceQuery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpSpaceQuery.c b/src/cpSpaceQuery.c index 1ce4a10c..c6011a25 100644 --- a/src/cpSpaceQuery.c +++ b/src/cpSpaceQuery.c @@ -224,7 +224,7 @@ ShapeQuery(cpShape *a, cpShape *b, cpCollisionID id, struct ShapeQueryContext *c cpContactPointSet set = cpShapesCollide(a, b); if(set.count){ if(context->func) context->func(b, &set, context->data); - context->anyCollision = !(a->sensor || b->sensor); + context->anyCollision |= !(a->sensor || b->sensor); } return id;