Chiyu
Prince
Hey guys, I'd like to have a building that can only be built as long as as a resource - in this case, Gold - is in the city's radius (as in Civ5, yes). I tried to copy and alter the code from Tsentom's code for the Great Mosque of Djenne, but I have no idea why it's not working as it should. If anyone could help me, I'd be grateful
.

Code:
def cannotConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
### Mint Start ###
if ( eBuilding == gc.getInfoTypeForString("BUILDING_MINT") ):
pPlayer = gc.getPlayer(pCity.plot().getOwner())
iPID = pPlayer.getID()
iTID = pPlayer.getTeam()
iX = pCity.getX()
iY = pCity.getY()
bt_gold = gc.getInfoTypeForString( 'BONUS_GOLD' )
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.getBonusType()==bt_gold ):
return False
return True
### Mint End ###