about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2012-06-04 11:34:23 -0400
committerStarla Insigna <hatkirby@fourisland.com>2012-06-04 11:34:23 -0400
commit4c1ce3df77273d198c6d8f42fd0e22b55ec9f3cd (patch)
tree3a67936ceb09fb906d1e94b36f65659159193eee /src
parentf0a7403875a840f2eedcf03aec53461eb1fbdc1a (diff)
downloadfrigidearth-4c1ce3df77273d198c6d8f42fd0e22b55ec9f3cd.tar.gz
frigidearth-4c1ce3df77273d198c6d8f42fd0e22b55ec9f3cd.tar.bz2
frigidearth-4c1ce3df77273d198c6d8f42fd0e22b55ec9f3cd.zip
Fixed bug where mobs would move onto each other
Diffstat (limited to 'src')
-rw-r--r--src/com/fourisland/frigidearth/MapViewGameState.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/fourisland/frigidearth/MapViewGameState.java b/src/com/fourisland/frigidearth/MapViewGameState.java index 732f340..3b8489d 100644 --- a/src/com/fourisland/frigidearth/MapViewGameState.java +++ b/src/com/fourisland/frigidearth/MapViewGameState.java
@@ -868,7 +868,21 @@ public class MapViewGameState implements GameState
868 868
869 if (path != null) 869 if (path != null)
870 { 870 {
871 mob.moveInDirection(path.get(0)); 871 Point to = path.get(0).to(mob.getPosition());
872 boolean found = false;
873 for (Mob m : mobs)
874 {
875 if (m.getPosition().equals(to))
876 {
877 found = true;
878 break;
879 }
880 }
881
882 if (!found)
883 {
884 mob.moveInDirection(path.get(0));
885 }
872 } 886 }
873 } 887 }
874 } else { 888 } else {