From da98ff806d0a0297dfc072ddc369a610936b9da4 Mon Sep 17 00:00:00 2001 From: Allanis Date: Fri, 7 Mar 2014 19:35:09 +0000 Subject: [PATCH] [Fix] Ignore weird collisions in lines. --- src/collision.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/collision.c b/src/collision.c index 102caa5..3eb9706 100644 --- a/src/collision.c +++ b/src/collision.c @@ -163,14 +163,14 @@ int CollideLineSprite(const Vec2* ap, double ad, double al, /* Left border. */ if(CollideLineLine(ap->x, ap->y, ep[0], ep[1], - bl[0], bl[1], bl[0], tr[1], &tmp_crash) != 0) { + bl[0], bl[1], bl[0], tr[1], &tmp_crash) == 0) { border[hits].x = tmp_crash.x; border[hits].y = tmp_crash.y; hits++; } /* Top border. */ if(CollideLineLine(ap->x, ap->y, ep[0], ep[1], - bl[0], tr[1], tr[0], tr[1], &tmp_crash) != 0) { + bl[0], tr[1], tr[0], tr[1], &tmp_crash) == 0) { border[hits].x = tmp_crash.x; border[hits].y = tmp_crash.y; hits++; @@ -178,14 +178,14 @@ int CollideLineSprite(const Vec2* ap, double ad, double al, /* Now we are going to have to make sure hits isn't 2. */ /* Right border. */ if((hits < 2) && CollideLineLine(ap->x, ap->y, ep[0], ep[1], - tr[0], tr[1], tr[0], bl[1], &tmp_crash) != 0) { + tr[0], tr[1], tr[0], bl[1], &tmp_crash) == 0) { border[hits].x = tmp_crash.x; border[hits].y = tmp_crash.y; hits++; } /* Bottom border. */ if((hits < 2) && CollideLineLine(ap->x, ap->y, ep[0], ep[1], - tr[0], bl[1], bl[0], bl[1], &tmp_crash) != 0) { + tr[0], bl[1], bl[0], bl[1], &tmp_crash) == 0) { border[hits].x = tmp_crash.x; border[hits].y = tmp_crash.y; hits++;