From 4c1ce3df77273d198c6d8f42fd0e22b55ec9f3cd Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 4 Jun 2012 11:34:23 -0400 Subject: Fixed bug where mobs would move onto each other --- src/com/fourisland/frigidearth/MapViewGameState.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 if (path != null) { - mob.moveInDirection(path.get(0)); + Point to = path.get(0).to(mob.getPosition()); + boolean found = false; + for (Mob m : mobs) + { + if (m.getPosition().equals(to)) + { + found = true; + break; + } + } + + if (!found) + { + mob.moveInDirection(path.get(0)); + } } } } else { -- cgit 1.4.1