diff --git a/server/states/BaseState.js b/server/states/BaseState.js index a603208..f06e4f4 100644 --- a/server/states/BaseState.js +++ b/server/states/BaseState.js @@ -130,13 +130,13 @@ export class BaseState { const diff = (targetFacing - currentFacing + 4) % 4; if (diff === 1) { - await this.exec('return turtle.turnRight()'); + await this.exec(`turtle.turnRight(); _G._turtleFacing = ${targetFacing}`); this.turtle.facing = targetFacing; } else if (diff === 2) { - await this.exec('turtle.turnRight(); return turtle.turnRight()'); + await this.exec(`turtle.turnRight(); turtle.turnRight(); _G._turtleFacing = ${targetFacing}`); this.turtle.facing = targetFacing; } else if (diff === 3) { - await this.exec('return turtle.turnLeft()'); + await this.exec(`turtle.turnLeft(); _G._turtleFacing = ${targetFacing}`); this.turtle.facing = targetFacing; }