Remove controllable instead of checking health

This commit is contained in:
Askou
2021-06-17 10:29:29 +02:00
parent 811e478ca9
commit 6ca2b90291
2 changed files with 4 additions and 1 deletions
@@ -22,7 +22,7 @@ namespace BBM
auto health = entity->tryGetComponent<HealthComponent>();
Vector2f move = controllable.move.normalized() * controllable.speed;
if (health->getHealthPoint() <= 0)
if (health && health->getHealthPoint() <= 0)
return;
movable.addForce(Vector3f(move.x, 0, move.y));
}