Support multiple deferred payments in public deals
Verify and publish checkpoint container / container (push) Successful in 10m22s

This commit is contained in:
Quintine committed 2026-11-16 14:30:36 +11:00
1 parent 0b8a147388
commit cacc88906c
12 files changed
+742 -50

No files matched your search

+4 -2
View File
@@ -4401,10 +4401,12 @@ export function botActions(g: GameView): Action[] {
if ((dealPayer?.bot || dealPayer?.autopilot) && g.status === 'playing' &&
!g.roomControl?.paused && !g.roomControl?.closed && !g.automaticContinuationPending) {
const payable = Object.entries(g.deferredDealPaymentOptions ?? {}).find(([id,option]) => {
const payment = g.deals.find(deal => deal.id === id)?.payment;
const deal = g.deals.find(row => row.id === (option.deal ?? id));
const payment = option.paymentIndex === undefined ? deal?.payment : deal?.additionalPayments?.[option.paymentIndex]?.payment;
return !option.blocked && payment?.kind === 'deferredBribe' && payment.dueTurn <= g.turn;
});
if (payable) return [{type:'dealPay',deal:payable[0]}];
if (payable) return [{type:'dealPay',deal:payable[1].deal ?? payable[0],
...(payable[1].paymentIndex === undefined ? {} : {paymentIndex:payable[1].paymentIndex})}];
}
if (g.decision?.kind === 'homeworldTupileCleanup' || g.homeworldTupileCleanup)
return tupileCleanupActions(g);