diff --git a/Core/Goals/CombatGoal.cs b/Core/Goals/CombatGoal.cs index 5d37fd34..ea18b1f2 100644 --- a/Core/Goals/CombatGoal.cs +++ b/Core/Goals/CombatGoal.cs @@ -48,7 +48,7 @@ public CombatGoal(ILogger logger, ConfigurableInput input, AddPrecondition(GoapKey.incombat, true); AddPrecondition(GoapKey.hastarget, true); - AddPrecondition(GoapKey.targetisalive, true); + //AddPrecondition(GoapKey.targetisalive, true); AddPrecondition(GoapKey.targethostile, true); //AddPrecondition(GoapKey.targettargetsus, true); AddPrecondition(GoapKey.incombatrange, true); @@ -106,7 +106,12 @@ public override void OnExit() public override void Update() { wait.Update(); - + if (bits.Target_Dead()) + { + // sometimes the combat can be stuck on a dead target + // clear target and move on + input.PressClearTarget(); + } if (MathF.Abs(lastDirection - playerReader.Direction) > MathF.PI / 2) { logger.LogInformation("Turning too fast!"); @@ -125,6 +130,7 @@ public override void Update() if (bits.Target()) { + if (bits.TargetDead()) { if (classConfig.AutoPetAttack && bits.Pet() && (!playerReader.PetTarget() || playerReader.PetTargetGuid != playerReader.TargetGuid) && @@ -216,4 +222,4 @@ private Vector3 GetCorpseLocation(float distance) { return PointEstimator.GetPoint(playerReader.MapPos, playerReader.Direction, distance); } -} \ No newline at end of file +}