Permalink
Browse files

Fix for guards movement on dead ends

  • Loading branch information...
1 parent 4ffbd62 commit 2ac67fbb34a0e17fe2d9da5bb49578985e60996b @HenJi committed Oct 19, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/ghost.opa
View
@@ -99,8 +99,10 @@
else false
bias = List.filter(can_see, opts)
if bias == [] then
- back = Base.Dir.back(bg.dir)
- List.filter(x -> x!=back, opts)
+ if List.length(opts) == 1 then opts
+ else
+ back = Base.Dir.back(bg.dir)
+ List.filter(x -> x!=back, opts)
else bias
move_one_generic(ghost, move_fun)

0 comments on commit 2ac67fb

Please sign in to comment.