summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ch/epfl/maze/physical/ProbabilisticAnimal.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/physical/ProbabilisticAnimal.java b/src/ch/epfl/maze/physical/ProbabilisticAnimal.java
index 6b0c57f..f62fea1 100644
--- a/src/ch/epfl/maze/physical/ProbabilisticAnimal.java
+++ b/src/ch/epfl/maze/physical/ProbabilisticAnimal.java
@@ -32,6 +32,7 @@ abstract public class ProbabilisticAnimal extends Animal {
32 32
33 @Override 33 @Override
34 public Direction move(Direction[] choices) { 34 public Direction move(Direction[] choices) {
35 if (choices.length == 0) return Direction.NONE;
35 return choices[randomSource.nextInt(choices.length)]; 36 return choices[randomSource.nextInt(choices.length)];
36 } 37 }
37 38