Skip to content

Commit

Permalink
Only run repair if we have armor damage.
Browse files Browse the repository at this point in the history
If you have no armor damage but use drones it will still repair drones...
  • Loading branch information
ISeeDEDPpl committed Aug 31, 2013
1 parent 4c341f5 commit 760e4e1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Questor.Modules/Actions/Arm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 12 additions & 0 deletions Questor.Modules/BackgroundTasks/Panic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Questor.Modules/Caching/Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit 760e4e1

Please sign in to comment.