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.
This commit is contained in:
Bast75 2020-06-11 22:00:19 +02:00 committed by GitHub
parent d9e287e08b
commit 0dd1e66497
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}