RogerBacon
King
- Joined
- Nov 16, 2003
- Messages
- 649
The following code gives an error "AttributeError: 'CyMap' object has no attribute 'getPlot'" on the line: pPlot = gc.getMap().getPlot(iX, iY) .
Now, I KNOW that CyMap objects DO have attribute of getPlotso I don't know why this isn't working. Any ideas?
Roger Bacon
Now, I KNOW that CyMap objects DO have attribute of getPlotso I don't know why this isn't working. Any ideas?
Roger Bacon
Code:
for i in range(3):
for ii in range(3):
iX = i-1 + plotX
iY = ii-1 + plotY
if (gc.getMap().isPlot(iX, iY)): # Make sure this plot is on the map.
pPlot = gc.getMap().getPlot(iX, iY)
plotCulture = pPlot.getCulture(gc.getGame().getActivePlayer())
pPlot.setCulture(gc.getGame().getActivePlayer(), plotCulture+amount)
#pPlot.setCulture(gc.getGame().getActivePlayer(), plotCulture+amount)