OrionVeteran
Deity
The following code looks correct, but fails to prevent "Slave Cage" building from appearing on the production list, when the player has not changed labor civic to slavery. The slave cage appears on the list when it should not.
and...
What have I missed?
Orion Veteran
Spoiler :
Code:
def canConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
pPlayer = gc.getPlayer(pCity.getOwner())
if eBuilding == gc.getInfoTypeForString("BUILDING_SLAVE_CAGE"):
if (pPlayer.getCivics(gc.getInfoTypeForString("CIVICOPTION_LABOR")) == gc.getInfoTypeForString("CIVIC_SLAVERY")):
return True
return False
and...
Spoiler :
Code:
def cannotConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
pPlayer = gc.getPlayer(pCity.getOwner())
if eBuilding == gc.getInfoTypeForString("BUILDING_SLAVE_CAGE"):
if not (pPlayer.getCivics(gc.getInfoTypeForString("CIVICOPTION_LABOR")) == gc.getInfoTypeForString("CIVIC_SLAVERY")):
return True
return False
What have I missed?
Orion Veteran