I’m in the level “Sarven Brawl” in the Sarven Desert.
This is part of my code… :
while True: enemiesInSight = hero.findEnemies() for n in enemiesInSight: if isPartOf(enemiesInSight[n], doNotAttack) == True: break nDistance = hero.distanceTo(enemiesInSight[n].pos) if n < 1 : nearestEnemy = enemiesInSight[n] else: if nDistance < hero.distanceTo(nearestEnemy): nearestEnemy = enemiesInSight[n] enemy = nearestEnemy
…but the game returns me:
And i don’t understand why. Can someone help me ?
EDIT: more info
It seems what the rubber duck says at the end of the error message (in the case of my screenshot, Vyle, but i’ve also seen Polyfemo once) is the name of… an enemy… I think
So, does that mean the method
hero.findEnemies() which should return a whole array of enemies only returns one, which turns into the wrong type of variable… which is a problem ?
What do you think ?