Can't find the bones in Bonemender (Forest)


#1

I’ve just tried playing the sorcerer for the first time… and I’m stuck already.

I don’t get any errors, so it must be my logic. The strange thing is that the code to heal my troops was provided to me by the game, yet my hero doesn’t heal or attack.

Anyone know what I’m doing wrong?

loop;
{
    if (this.canCast("regen")) {
        var bernardDistance = this.distanceTo("Bernard");
        if (bernardDistance < 10) {
            this.cast("regen", "Bernard");
        }
        var chandraDistance = this.distanceTo("Chandra");
        if (chandraDistance < 10) {
            this.cast("regen", "Chandra");
        }
    } else {
        var enemy = this.findNearest(this.findEnemies());
        if (enemy) {
            if (this.distanceTo(enemy) < this.attackRange) {
                this.attack(enemy);
            }
        }
    }
}

#2

There should be no semicolon after the loop keyword.


#3

:blush: I don’t know how that got up there and I was only searching the code blocks.

Thanks UltCombo!


#4

Doing Alpine Rally level now, and at some point the game inserts a ; after the loop keyword by itself. I’m only working within the game’s code editor, and have only left the editor to read the help section.

Maybe there’s a bug?


#5

Found the bug!

When I click the (magnet looking icon) Beutify Your Code button, it changes

loop {

to

loop;
{

I’m using JavaScript, could be that Python coders etc. don’t experience this issue.

I’ve already submitted the bug to GitHub.


#6

Then it is a bug with the code beautifier, nice find! :slight_smile:
And thanks for reporting it in the repository. :smile:

p.s. Just in case, here’s the link to the GitHub issue.