From dcf55ed93fa73096c9c11b1812bab2117a84d43e Mon Sep 17 00:00:00 2001 From: algebro Date: Thu, 19 Sep 2024 16:27:28 -0400 Subject: [PATCH] implement addAtBContract --- .../market/contractMarket/CamOpsContractMarket.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/market/contractMarket/CamOpsContractMarket.java b/MekHQ/src/mekhq/campaign/market/contractMarket/CamOpsContractMarket.java index 93443e99af..7a543deb96 100644 --- a/MekHQ/src/mekhq/campaign/market/contractMarket/CamOpsContractMarket.java +++ b/MekHQ/src/mekhq/campaign/market/contractMarket/CamOpsContractMarket.java @@ -36,6 +36,12 @@ public CamOpsContractMarket() { @Override public AtBContract addAtBContract(Campaign campaign) { + Optional c = generateContract(campaign); + if (c.isPresent()) { + AtBContract atbContract = c.get(); + contracts.add(atbContract); + return atbContract; + } return null; } @@ -58,8 +64,7 @@ public void generateContractOffers(Campaign campaign, boolean newCampaign) { rollNegotiation(negotiationSkill, ratingMod + contractMods.offersMod) - BASE_NEGOTIATION_TARGET); for (int i = 0; i < numOffers; i++) { - Optional c = generateContract(campaign); - c.ifPresent(contract -> contracts.add(contract)); + addAtBContract(campaign); } updateReport(campaign); }