From ce7c2b7b69ab2e689f73a6d082c643c5c6b8d9a4 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 4 Jun 2012 13:01:20 -0400 Subject: Fixed bug where mice would move onto positions in use by other mobs --- src/com/fourisland/frigidearth/MapViewGameState.java | 17 +++++++++++++++-- 1 file 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 Point to = toDir.to(mob.getPosition()); if ((isValidPosition(to.x,to.y)) && (!grid[to.x][to.y].isBlocked()) && (!to.equals(new Point(playerx, playery)))) { - mob.moveInDirection(toDir); - break; + boolean found = false; + for (Mob m : mobs) + { + if (m.getPosition().equals(to)) + { + found = true; + break; + } + } + + if (!found) + { + mob.moveInDirection(toDir); + break; + } } } } -- cgit 1.4.1