mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-18 01:27:25 +01:00
Bugfix: Save spawned monsters on current map after having rested there.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user