Skip to content

Commit

Permalink
feat: let multiple ships buy mounts at once if we have more than 10Mc
Browse files Browse the repository at this point in the history
  • Loading branch information
eseidel committed Sep 30, 2023
1 parent 2b501ba commit 34e34f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/cli/lib/behavior/central_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,13 @@ class CentralCommand {
/// Returns true if [ship] should start the mountFromBuy behavior.
bool shouldBuyMount(Ship ship, int credits) {
// Are there any other ships actively buying mounts?
if (_behaviorCache.states.any(
bool otherShipsAreBuyingMounts = _behaviorCache.states.any(
(s) => s.behavior == Behavior.mountFromBuy,
)) {
);
// Only enforce the "one at a time" when we have less than 10M credits.
// The 10M is mostly a hack to allow deploying changes to mounts quickly
// late game.
if (credits < 10000000 || otherShipsAreBuyingMounts) {
return false;
}
// Does this ship have a mount it needs?
Expand Down

0 comments on commit 34e34f5

Please sign in to comment.