diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index b59e56ab3..1be21bf41 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -82,6 +82,7 @@ public class Heap implements Bundlable { public int pos = 0; public ItemSprite sprite; + public boolean seen = false; public LinkedList items = new LinkedList(); @@ -457,6 +458,7 @@ public class Heap implements Bundlable { } private static final String POS = "pos"; + private static final String SEEN = "seen"; private static final String TYPE = "type"; private static final String ITEMS = "items"; @@ -464,6 +466,7 @@ public class Heap implements Bundlable { @Override public void restoreFromBundle( Bundle bundle ) { pos = bundle.getInt( POS ); + seen = bundle.getBoolean( SEEN ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList( (Collection) ((Collection) bundle.getCollection( ITEMS )) ); items.removeAll(Collections.singleton(null)); @@ -472,6 +475,7 @@ public class Heap implements Bundlable { @Override public void storeInBundle( Bundle bundle ) { bundle.put( POS, pos ); + bundle.put( SEEN, seen ); bundle.put( TYPE, type.toString() ); bundle.put( ITEMS, items ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 25d8e87ba..e0b4223f6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -952,6 +952,10 @@ public abstract class Level implements Bundlable { } } } + + for (Heap heap : heaps.values()) + if (!heap.seen && fieldOfView[heap.pos]) + heap.seen = true; return fieldOfView; }