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:
parent
d9e287e08b
commit
0dd1e66497
1 changed files with 15 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue