Damage actor handler

This commit is contained in:
Marco 2025-02-23 18:08:57 +01:00
commit 4fd31d7988
7 changed files with 100 additions and 4 deletions

View file

@ -19,6 +19,8 @@ public partial class EnemyNavigationMovement : MovementHandler
set => _parent.MovementDirection = value;
}
public bool IsDestroyed => _parent.IsDestroyed;
[Export] private bool _navigationEnabled = false;
[Export] public float AlarmReactRange = 200f;
@ -83,6 +85,7 @@ public partial class EnemyNavigationMovement : MovementHandler
public override void PhysicsUpdate(double delta)
{
if (IsDestroyed) return;
if (_actorAi.Ai is not AiState.Enabled)
return;
@ -149,7 +152,6 @@ public partial class EnemyNavigationMovement : MovementHandler
Shoot();
}
}
break;
}
}