Skip to content

Commit ce5197e

Browse files
authored
Fixed IO_COMPASS to be bound from -PI to +PI. (#91)
1 parent 35defc9 commit ce5197e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/asmcup/runtime/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ protected void handleIO(World world) {
355355
vm.push8(world.recv(this, frequency));
356356
break;
357357
case IO_COMPASS:
358-
vm.pushFloat(facing);
358+
vm.pushFloat(facing % (float)Math.PI);
359359
break;
360360
default:
361361
lastInvalidIO = world.getFrame();

0 commit comments

Comments
 (0)