summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Schodet2010-05-15 08:19:53 +0200
committerNicolas Schodet2010-05-15 08:19:53 +0200
commitf9a1a8d5553f0b954e5be31001f282ffbbc7fc4a (patch)
treee9793163ce5ec35b4d0ba56c63005982da1b98a6
parentd2532bc63ba22c4e24be0b4b4142c492489bf8e2 (diff)
digital/io/src: avoid food near ISEP robot
-rw-r--r--digital/io/src/food.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/digital/io/src/food.c b/digital/io/src/food.c
index ab81a6a8..20f22296 100644
--- a/digital/io/src/food.c
+++ b/digital/io/src/food.c
@@ -193,6 +193,9 @@ food_score (position_t robot_pos, uint8_t food)
score -= 300;
if (v.y < BOT_SIZE_RADIUS)
score -= 500;
+ /* Avoid food near ISEP robot. */
+ if ((bot_color && food <= 4) || (!bot_color && food >= 14 && food <= 18))
+ score -= 2000;
/* Done. */
return score;
}