The following phrase will never trigger:
pPlayer2.getBuildingClassMaking(gc.getInfoTypeForString('BUILDINGCLASS_ALTAR_OF_THE_LUONNOTAR_DIVINE')) > 0
This is because this building is never in the BuildingClassMaking state. that state is only entered if the Build order is entered for the city, not on instant creation via unit (CvUnit::construct).
Rank:
The concept of Rank isn't used consistently. An Elven war only starts if the requesting player is of higher rank, whereas an Infernal/Doviello/high Armageddon count Evil player war only starts if the requesting player is of lower rank. Even worse, said calculation isn't consistent - the first pass checks for a higher-ranked other player (CyGame().getPlayerRank(iPlayer2) > CyGame().getPlayerRank(iPlayer)); the second check looks for a lower-ranked other player(CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iEnemy)). I would assume that one or the other is correct.
pPlayer2.getBuildingClassMaking(gc.getInfoTypeForString('BUILDINGCLASS_ALTAR_OF_THE_LUONNOTAR_DIVINE')) > 0
This is because this building is never in the BuildingClassMaking state. that state is only entered if the Build order is entered for the city, not on instant creation via unit (CvUnit::construct).
Rank:
The concept of Rank isn't used consistently. An Elven war only starts if the requesting player is of higher rank, whereas an Infernal/Doviello/high Armageddon count Evil player war only starts if the requesting player is of lower rank. Even worse, said calculation isn't consistent - the first pass checks for a higher-ranked other player (CyGame().getPlayerRank(iPlayer2) > CyGame().getPlayerRank(iPlayer)); the second check looks for a lower-ranked other player(CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iEnemy)). I would assume that one or the other is correct.