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 1e3090122..400681f83 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapCollection.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapCollection.java @@ -96,7 +96,7 @@ public final class MapCollection { dest.writeInt(mapsToExport.size()); for(PredefinedMap map : mapsToExport) { dest.writeUTF(map.name); - map.writeToParcel(dest, flags); + map.writeToParcel(dest, world, flags); } } } 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 ca5035d2b..073a248f3 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java @@ -157,8 +157,9 @@ public final class PredefinedMap { public boolean hasResetTemporaryData() { return lastVisitTime == VISIT_RESET; } - public boolean hasPersistentData() { + public boolean hasPersistentData(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; @@ -234,8 +235,8 @@ public final class PredefinedMap { } } - public void writeToParcel(DataOutputStream dest, int flags) throws IOException { - if (hasPersistentData()) { + public void writeToParcel(DataOutputStream dest, WorldContext world, int flags) throws IOException { + if (this.hasPersistentData(world)) { dest.writeBoolean(true); dest.writeInt(spawnAreas.length); for(MonsterSpawnArea a : spawnAreas) {