From 6ad9ef2571f8e573a875f92de0047ad098721c1f Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Wed, 5 Aug 2020 19:13:37 -0700 Subject: [PATCH] AI will now build radar. --- code/redalert/house.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/redalert/house.cpp b/code/redalert/house.cpp index 0b06902..b0c77ac 100644 --- a/code/redalert/house.cpp +++ b/code/redalert/house.cpp @@ -5799,6 +5799,16 @@ int HouseClass::AI_Building(void) } } + 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. */