[Question] IsVisible()

Phobia.

Chieftain
Joined
Jan 27, 2006
Messages
6
Hi all,

I am trying to collect a list of all visible plots.
For some reason, I get none after scanning the whole map.
Can someone spot my mistake? Is there an easier way to return a list with all visible plots?

Thanks for your help.

Code:
    lVisPlots = []
    pPopup = PyPopup.PyPopup()
    iHeight = CyMap().getGridHeight()
    iWidth = CyMap().getGridWidth()
    pUnit = CyInterface().getHeadSelectedUnit()
    iTeam = pUnit.getTeam()    
    pMap = gc.getMap()
    
    for i in range(0,iHeight+1):
        for j in range(0,iWidth+1):
            pPlot = pMap.plot(i,j)            
            if (pPlot.isVisible(iTeam, false)):
                lVisPlots.append(pPlot)
    popup.setBodyString("Number of visible plots %d" %(len(lVisPlots)))
    popup.launch()
 
Back
Top Bottom