diff --git a/Questor.Modules/Actions/Arm.cs b/Questor.Modules/Actions/Arm.cs index 257af8440..8f6f6cce1 100644 --- a/Questor.Modules/Actions/Arm.cs +++ b/Questor.Modules/Actions/Arm.cs @@ -446,15 +446,18 @@ public void ProcessState() case ArmState.RepairShop: if (DateTime.UtcNow < Cache.Instance.NextArmAction) return; - if (Settings.Instance.UseStationRepair && Cache.Instance.RepairAll) + if (Settings.Instance.UseStationRepair) { - if (!Cache.Instance.RepairItems("Arm.RepairShop [ALL]")) return; //attempt to use repair facilities if avail in station - } - else if (Settings.Instance.UseStationRepair && Settings.Instance.UseDrones) - { - if (!Cache.Instance.RepairDrones("Arm.RepairShop [Drones]")) return; //attempt to use repair facilities if avail in station + if (Cache.Instance.RepairAll && Cache.Instance.NeedRepair) + { + if (!Cache.Instance.RepairItems("Arm.RepairShop [ALL]")) return; //attempt to use repair facilities if avail in station + } + else if (Settings.Instance.UseDrones) + { + if (!Cache.Instance.RepairDrones("Arm.RepairShop [Drones]")) return; //attempt to use repair facilities if avail in station + } } - + _States.CurrentArmState = ArmState.LoadSavedFitting; break; diff --git a/Questor.Modules/BackgroundTasks/Panic.cs b/Questor.Modules/BackgroundTasks/Panic.cs index a9b9ea950..e85dd143c 100644 --- a/Questor.Modules/BackgroundTasks/Panic.cs +++ b/Questor.Modules/BackgroundTasks/Panic.cs @@ -100,6 +100,18 @@ public void ProcessState() return; } + if (Cache.Instance.InSpace && Cache.Instance.DirectEve.ActiveShip.ArmorPercentage < 100) + { + Cache.Instance.NeedRepair = true; + // + // do not return here, we are just setting a flag for use by arm to repair or not repair... + // + } + else if (Cache.Instance.InSpace) + { + Cache.Instance.NeedRepair = false; + } + if (Cache.Instance.InMission && Cache.Instance.InSpace && Cache.Instance.DirectEve.ActiveShip.CapacitorPercentage < Settings.Instance.MinimumCapacitorPct && Cache.Instance.DirectEve.ActiveShip.GroupId != 31) { // Only check for cap-panic while in a mission, not while doing anything else diff --git a/Questor.Modules/Caching/Cache.cs b/Questor.Modules/Caching/Cache.cs index 91bd3a25f..02e5b0dde 100644 --- a/Questor.Modules/Caching/Cache.cs +++ b/Questor.Modules/Caching/Cache.cs @@ -424,6 +424,7 @@ public static Cache Instance public bool SalvageAll = false; public bool RouteIsAllHighSecBool = false; public bool CurrentlyShouldBeSalvaging = false; + public bool NeedRepair = false; public double Wealth { get; set; }