From 420e7b88f9e103fa6b197e66053102197483af54 Mon Sep 17 00:00:00 2001 From: XProger Date: Sun, 27 Jan 2019 00:38:05 +0300 Subject: [PATCH] fix enemies collision (door bottleneck bug) --- src/enemy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enemy.h b/src/enemy.h index 7a27b23..06acd51 100644 --- a/src/enemy.h +++ b/src/enemy.h @@ -168,7 +168,7 @@ struct Enemy : Character { if (enemy->health > 0.0f) { vec3 dir = vec3(enemy->pos.x - pos.x, 0.0f, enemy->pos.z - pos.z); float D = dir.length2(); - float R = float(enemy->radius + radius); + float R = float((enemy->radius + radius) / 2); if (D < R * R) { D = sqrtf(D); pos -= dir.normal() * (R - D);