summaryrefslogtreecommitdiff
path: root/physics.c
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-04-30 19:20:11 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-04-30 19:20:11 -0300
commit865764b50eb97bf43f5b37fc212b79aceb809ffe (patch)
tree63ebf5fcc00235452ae8127d1932fc889ef8a391 /physics.c
parente1700eb7aaaffe3986980adb5ab05525ecbc4d43 (diff)
fix entity check loop on physics
Diffstat (limited to 'physics.c')
-rw-r--r--physics.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/physics.c b/physics.c
index 51f8999..94b15e8 100644
--- a/physics.c
+++ b/physics.c
@@ -47,10 +47,10 @@ entphysics(float delta)
}
}
- for(int j = i; j < ebufi; j++) {
+ for(int j = i; j >= 0; j--) {
Entity *f = entitybuffer + j;
- if(!f->active)
- break;
+ if(!f->active || f == e)
+ continue;
if(checkcollision(&e->body, &f->body)) {
EntityCollision cl;