Ok, so, I'm still having a problem with these building-destruction events. I've updated the conditional check to:
In the particular example that I spotted the problem, the building affected is a Termite Mound, and I already have the Cooking tech, but the building is still being destroyed. I've verified via debugging that isObsoleteBuilding is indeed returning FALSE, even though the building is definitely obsolete.
Am I just misunderstanding what this function does? Or what am I doing wrong here?
Code:
if (city.getNumRealBuilding(iBuilding) > 0 and gc.getBuildingInfo(iBuilding).getProductionCost() > 0 and not isLimitedWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType()) and not gc.getTeam(player.getTeam()).isObsoleteBuilding(gc.getBuildingInfo(iBuilding).getBuildingClassType())):
In the particular example that I spotted the problem, the building affected is a Termite Mound, and I already have the Cooking tech, but the building is still being destroyed. I've verified via debugging that isObsoleteBuilding is indeed returning FALSE, even though the building is definitely obsolete.
Am I just misunderstanding what this function does? Or what am I doing wrong here?