Tobis Programm forked to not destroy your golden files

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
57:1a395b6928ee
Parent:
52:56399c2f13cd
Child:
60:b57577b0072f
--- a/source/Mapping.cpp	Tue Apr 18 13:43:44 2017 +0000
+++ b/source/Mapping.cpp	Tue Apr 18 15:38:15 2017 +0000
@@ -39,7 +39,7 @@
             set_servo_position(0, servo_angle);
             float distance = getDistanceIR(1);
             int object = 0;
-            if(distance < 0.75f && distance > 0.1f && distance -0.05f < distance0 && distance + 0.05f > distance0) {
+            if(distance < 0.75f && distance > 0.1f && (distance -0.05f < distance0 || distance + 0.05f > distance0)) {
                 object = 0;
             } else {
                 object = 1;
@@ -53,7 +53,7 @@
             set_servo_position(1, -servo_angle);
             float distance = getDistanceIR(5);
             int object = 0;
-            if(distance < 0.75f && distance > 0.1f && distance -0.05f < distance4 && distance + 0.05f > distance4) {
+            if(distance < 0.75f && distance > 0.1f && (distance -0.05f < distance4 || distance + 0.05f > distance4)) {
                 object = 0;
             } else {
                 object = 1;
@@ -66,7 +66,7 @@
         if(distance2 < 0.75f && distance2 > 0.1f) {
             float distance = getDistanceIR(3);
             int object = 0;
-            if(distance < 0.75f && distance > 0.1f && distance -0.05f < distance2 && distance + 0.05f > distance2) {
+            if(distance < 0.75f && distance > 0.1f && (distance -0.05f < distance2 || distance + 0.05f > distance2)) {
                 object = 0;
             } else {
                 object = 1;