From 0dd1e664977e1d60f396263fb5a498bfadfa4145 Mon Sep 17 00:00:00 2001 From: Bast75 <38682537+Bast75@users.noreply.github.com> Date: Thu, 11 Jun 2020 22:00:19 +0200 Subject: [PATCH] Update HOUSE.CPP Bugfix: AI only builds a Dome if enemy has air units and it wants Air Defence, Now it can build a dome and unlock the rest of the units and buildings without waiting for Enemy Air stuff. --- REDALERT/HOUSE.CPP | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/REDALERT/HOUSE.CPP b/REDALERT/HOUSE.CPP index a228ab6..fb05acb 100644 --- a/REDALERT/HOUSE.CPP +++ b/REDALERT/HOUSE.CPP @@ -5787,6 +5787,20 @@ int HouseClass::AI_Building(void) } } + + /* + ** Build a Dome. + */ + if (BQuantity[STRUCT_RADAR] == 0) { + b = &BuildingTypeClass::As_Reference(STRUCT_RADAR); + if (Can_Build(b, ActLike) && (b->Cost_Of() < money || hasincome)) { + choiceptr = BuildChoice.Alloc(); + if (choiceptr != NULL) { + *choiceptr = BuildChoiceClass(URGENCY_MEDIUM, b->Type); + } + } + } + /* ** Build some air defense. */ @@ -8170,4 +8184,4 @@ void HouseClass::Free_Unit_Trackers(void) delete TotalCrates; TotalCrates = NULL; } -} \ No newline at end of file +}