Hi,
i want to implement a restriction for a certain type of buildings in such a way that you need a minimum amount of a certain building before you can construct them,e.g.
with this bit of code in CvGameUtils.py in the def cannotConstruct function, forces you to build at least 3 iBuilding4 for every iBuilding1, iBuilding,2 or iBuilding3.
However it only checks if i can start production, i.e. once i have 3 iBuilding4 i can build and finish multiple iBuilding1, iBuilding2 or iBuilding3.
Is there a function that checks if iBuilding1, iBuilding2, or iBuilding3 is already contructing, so i can add those to iBuildCount as well?
i want to implement a restriction for a certain type of buildings in such a way that you need a minimum amount of a certain building before you can construct them,e.g.
Code:
if eBuilding == iBuilding1 or eBuilding == iBuilding2 or eBuilding == iBuilding3:
iBuildCount = pPlayer.countNumBuildings(iBuilding1) + pPlayer.countNumBuildings(iBuilding2) + pPlayer.countNumBuildings(iBuilding3)
iBaseBuildCount = pPlayer.countNumBuildings(iBuilding4)
if iBuildCount*3 >= iBaseBuildCount and iBaseBuildCount > 2:
return True
However it only checks if i can start production, i.e. once i have 3 iBuilding4 i can build and finish multiple iBuilding1, iBuilding2 or iBuilding3.
Is there a function that checks if iBuilding1, iBuilding2, or iBuilding3 is already contructing, so i can add those to iBuildCount as well?