Skip to content

Commit ea7387e

Browse files
committed
fix: update visibility logic for enemy health bar based on maxDistance configuration
1 parent 81a1207 commit ea7387e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/game/systems/enemy-health-bar.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ namespace gameplay {
9999
float distance = glm::distance(enemyPosition, cameraPos);
100100

101101
bool visibleWhenDamaged = health->damageRevealTimer > 0.0f;
102-
bool visibleWhenClose = distance <= 8.0f;
102+
bool visibleWhenClose = distance <= config.maxDistance;
103103

104-
if (!visibleWhenDamaged && distance > config.maxDistance) continue;
105104
if (!(visibleWhenDamaged || visibleWhenClose)) continue;
106105

107106
ColliderComponent* collider = entity->getComponent<ColliderComponent>();

0 commit comments

Comments
 (0)