Skip to content

Commit

Permalink
feat: improve refuel logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eseidel committed Oct 21, 2023
1 parent b47ded2 commit 1e3c021
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cli/lib/net/actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ bool _shouldRefuelBasedOnUsage(Ship ship) {
recentFuelSpend != null && recentFuelSpend < twentyPercentTank;
if (ship.isMiner && takingShortTrips) {
// If we're a miner, we should only refuel if we're below 50% fuel.
shipDetail(
ship,
'Not refueling yet, last trip was short ($recentFuelSpend fuel)'
' and at ${(100.0 * ship.fuelPercentage).toStringAsFixed(1)}% fuel.');
return ship.fuelPercentage < 0.5;
}
return true;
Expand All @@ -297,7 +301,6 @@ Future<RefuelShip200ResponseData?> refuelIfNeededAndLog(
return null;
}
if (!_shouldRefuelBasedOnUsage(ship)) {
shipInfo(ship, 'Not refueling yet due to recent fuel usage patterns.');
return null;
}
if (!_shouldRefuelAfterCheckingPrice(
Expand Down

0 comments on commit 1e3c021

Please sign in to comment.