diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapCollection.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapCollection.java index c30eefb68..d0a9c6a31 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapCollection.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapCollection.java @@ -84,7 +84,7 @@ public final class MapCollection { private static boolean shouldSaveMap(WorldContext world, PredefinedMap map) { if (map.visited) return true; - if (map == world.model.currentMap) return true; + if (map.shouldSaveMapData(world)) return true; return false; } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java index 0a8154b07..fe0bd8b42 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java @@ -181,19 +181,6 @@ public final class PredefinedMap { public boolean hasResetTemporaryData() { return lastVisitTime == VISIT_RESET; } - private boolean shouldSaveMapData(WorldContext world) { - if (!hasResetTemporaryData()) return true; - if (this == world.model.currentMap) return true; - if (!groundBags.isEmpty()) return true; - for (MonsterSpawnArea a : spawnAreas) { - if (a.isUnique) return true; - if (a.isActive != a.isActiveForNewGame) return true; - } - for (MapObject o : eventObjects) { - if (o.isActive != o.isActiveForNewGame) return true; - } - return false; - } public void createAllContainerLoot() { for (MapObject o : eventObjects) { @@ -267,6 +254,20 @@ public final class PredefinedMap { } } + public boolean shouldSaveMapData(WorldContext world) { + if (!hasResetTemporaryData()) return true; + if (this == world.model.currentMap) return true; + if (!groundBags.isEmpty()) return true; + for (MonsterSpawnArea a : spawnAreas) { + if (this.visited && a.isUnique) return true; + if (a.isActive != a.isActiveForNewGame) return true; + } + for (MapObject o : eventObjects) { + if (o.isActive != o.isActiveForNewGame) return true; + } + return false; + } + public void writeToParcel(DataOutputStream dest, WorldContext world, int flags) throws IOException { if (shouldSaveMapData(world)) { dest.writeBoolean(true);