Optimize tower entity checking
This commit is contained in:
@@ -372,7 +372,11 @@ void updateTower(ecs_iter_t *it) {
|
||||
}
|
||||
}
|
||||
|
||||
if (target == 0) continue;
|
||||
if (target == 0) {
|
||||
const f32 CHECK_INTERVAL = 0.2f; // 5 times a second
|
||||
tower[i].fireElapsed = tower[i].fireCooldown - CHECK_INTERVAL;
|
||||
continue;
|
||||
}
|
||||
|
||||
Vector2 dir = Vector2Subtract(targetPos, center);
|
||||
dir = Vector2Normalize(dir);
|
||||
|
||||
Reference in New Issue
Block a user