Mahogany glasses problem?

I’m not sure if this is a bug, a programming error, or the range of a shaman and a thrower is just greater than Mahogany Glasses, but when I was playing Sarven Brawl, I was being attacked by a shaman and thrower, with a clear space between us. They were attacking me all they wanted, but I was just standing there. It wasn’t until an ogre walked in between that I was able to attack them. Here is my code:

loop:

    enemy = self.findNearest(self.findEnemies())
    flag = self.findFlag()
    if flag:
        self.pickUpFlag(flag)
    if self.gold > 20:
        self.summon("soldier")
    elif enemy and enemy.type is not "sand-yak":
        for friend in self.findFriends():
            self.command(friend, "move", self.pos)
            self.command(friend, "attack", enemy)
        if self.isReady("cleave") and self.distanceTo(enemy) < 10:
            self.shield()
            self.cleave(enemy)
        elif self.isReady("bash"):
            self.shield()
            self.bash(enemy)
        else:
            self.shield()
            self.attack(enemy)

The nearest enemy is (probably) a Sand Yak. So you don’t do anything.

3 Likes