These are both called when the python Foreign Advisor is asking whether a player has the holy city for 'NO_RELIGION' (value is -1). This looks like a bug in the EFA. The first assert is the catch in hasHolyCity on the NO_RELIGION, the second is an internal call, where it uses that index into an array. This will cause a crash even without BetterAI.
Have people reported crashing with the EFA? This should be easy to fix.
This is lines 331-334 of the CvExoticForeignAdvisor.py:
Code:
if (gc.getPlayer(iLoopPlayer).hasHolyCity (nPlayerReligion)):
szPlayerReligion = u"%c" %(objReligion.getHolyCityChar())
elif objReligion:
szPlayerReligion = u"%c" %(objReligion.getChar())
You need to add a check for no religion:
Code:
if (nPlayerReligion != -1): # -1 == NO_RELIGON
if (gc.getPlayer(iLoopPlayer).hasHolyCity (nPlayerReligion)):
szPlayerReligion = u"%c" %(objReligion.getHolyCityChar())
elif objReligion:
szPlayerReligion = u"%c" %(objReligion.getChar())
This fixes the assert and crash. I
posted this over on the EFA thread as well, but I do not know if anyone is still maintaining that component.
-Iustus