From 11ba3825bacbee03c63c2677ecb2c11b64bd3f07 Mon Sep 17 00:00:00 2001 From: Oskar Wiksten Date: Fri, 3 Aug 2012 12:30:06 +0200 Subject: [PATCH] Bugfix: more fixes to movement of blocked monsters when loading savegames. --- .../gpl/rpg/AndorsTrail/controller/MovementController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MovementController.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MovementController.java index 17fc74355..a93c5e800 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MovementController.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MovementController.java @@ -255,10 +255,12 @@ public final class MovementController implements TimedMessageTask.Callback { // If any monsters somehow spawned on an unwalkable tile, we move the monster to a new position on the spawnarea // This could happen if we change some tile to non-walkable in a future version. for (PredefinedMap map : world.maps.predefinedMaps) { + Coord playerPosition = null; + if (map == model.currentMap) playerPosition = model.player.position; for (MonsterSpawnArea a : map.spawnAreas) { for (Monster m : a.monsters) { if (!map.isWalkable(m.rectPosition)) { - Coord p = map.getRandomFreePosition(a.area, m.actorTraits.tileSize, model.player.position); + Coord p = map.getRandomFreePosition(a.area, m.actorTraits.tileSize, playerPosition); if (p == null) continue; m.position.set(p); }