Bugfix: Save spawned monsters on current map after having rested there.

This commit is contained in:
Oskar Wiksten
2013-06-30 16:37:36 +02:00
parent 341f27351a
commit 2deb8ee7ac
2 changed files with 5 additions and 4 deletions

View File

@@ -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);
}
}
}

View File

@@ -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) {