about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/fourisland/frigidearth/MapViewGameState.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/fourisland/frigidearth/MapViewGameState.java b/src/com/fourisland/frigidearth/MapViewGameState.java index 64ac2de..62fc632 100644 --- a/src/com/fourisland/frigidearth/MapViewGameState.java +++ b/src/com/fourisland/frigidearth/MapViewGameState.java
@@ -899,8 +899,21 @@ public class MapViewGameState implements GameState
899 Point to = toDir.to(mob.getPosition()); 899 Point to = toDir.to(mob.getPosition());
900 if ((isValidPosition(to.x,to.y)) && (!grid[to.x][to.y].isBlocked()) && (!to.equals(new Point(playerx, playery)))) 900 if ((isValidPosition(to.x,to.y)) && (!grid[to.x][to.y].isBlocked()) && (!to.equals(new Point(playerx, playery))))
901 { 901 {
902 mob.moveInDirection(toDir); 902 boolean found = false;
903 break; 903 for (Mob m : mobs)
904 {
905 if (m.getPosition().equals(to))
906 {
907 found = true;
908 break;
909 }
910 }
911
912 if (!found)
913 {
914 mob.moveInDirection(toDir);
915 break;
916 }
904 } 917 }
905 } 918 }
906 } 919 }