Monaldinio
Prince
If a certain building is finished, a Bunker Unit will be created in the city, but in some cases, it could be that there is already a bunker unit in the City...
In this case, finishing the building should not create another bunker unit.
Any Ideas?
In this case, finishing the building should not create another bunker unit.
Any Ideas?
PHP:
def onBuildingBuilt(self, argsList):
'Building Completed'
self.parent.onBuildingBuilt(self, argsList)
pCity, iBuildingType = argsList
game = gc.getGame()
player = pCity.getOwner()
pPlayer = gc.getPlayer(player)
pPlot = pCity.plot()
if iBuildingType == gc.getInfoTypeForString('BUILDING_PERIMETER_DEFENSE') or iBuildingType == gc.getInfoTypeForString('BUILDING_PIRATES_SEAWALL'):
pUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_BUNKER'), pCity.getX(), pCity.getY(), UnitAITypes.UNITAI_IMMOBILE, DirectionTypes.DIRECTION_NORTH)