hrochland
Prince
Can someone, please, check if is this code from CvGameUtils.py OK? Above all Forest Mod part. This part does to I can build MUSEUM building in city only in that case, when is IMPROVEMENT_EXPLORETEMPLE in activ scope of activity of this one city.
Now if I click on build museum button, game is crash
See you any error in code, please?
Now if I click on build museum button, game is crash

See you any error in code, please?
Code:
def cannotConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
### Forest Mod begins ###
###########################################################################################
bCannotConstruct = True
if eBuilding == gc.getInfoTypeForString("BUILDING_MUSEUM") :
iX = pCity.getX()
iY = pCity.getY()
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
pPlot = CyMap().plot(iiX,iiY)
if pPlot.getOwner() == pCity.getOwner():
if pPlot.getImprovementType() == gc.getInfoTypeForString("IMPROVEMENT_EXPLORETEMPLE"):
bCannotConstruct = False
if bCannotConstruct:
return True
###########################################################################################
### forest Mod ends ###
## Begin zLeaders
if leaders.cannotConstructBuilding(pCity.getOwner(), eBuilding):
return True
## End zLeaders
### MachuPicchu Mod begins ###
###########################################################################################
if ( eBuilding == gc.getInfoTypeForString("BUILDING_MACHU_PICCHU") ):
### find peaks within the city radius controlled by your team ###
pPlayer = gc.getPlayer(pCity.plot().getOwner())
iPID = pPlayer.getID()
iTID = pPlayer.getTeam()
iX = pCity.getX()
iY = pCity.getY()
for iXLoop in range(iX - 2, iX + 3, 1):
for iYLoop in range(iY - 2, iY + 3, 1):
pPlot = CyMap().plot(iXLoop, iYLoop)
if ( pPlot.isPlayerCityRadius(iPID)==true ):
if ( pPlot.getTeam()==iTID ):
if ( pPlot.isPeak()==true ):
return False
return True
###########################################################################################
### MachuPicchu Mod ends ###
return False