v3.1.1: fixed cases of landmark entries from beacon not being cleared
This commit is contained in:
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning;
|
import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Spell;
|
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Spell;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
public class ScrollHolder extends Bag {
|
public class ScrollHolder extends Bag {
|
||||||
@@ -54,6 +55,7 @@ public class ScrollHolder extends Bag {
|
|||||||
super.onDetach();
|
super.onDetach();
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
if (item instanceof BeaconOfReturning) {
|
if (item instanceof BeaconOfReturning) {
|
||||||
|
Notes.remove(Notes.Landmark.BEACON_LOCATION, ((BeaconOfReturning) item).returnDepth);
|
||||||
((BeaconOfReturning) item).returnDepth = -1;
|
((BeaconOfReturning) item).returnDepth = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ public class BeaconOfReturning extends Spell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setBeacon(Hero hero ){
|
private void setBeacon(Hero hero ){
|
||||||
|
if (returnDepth != -1){
|
||||||
|
Notes.remove(Notes.Landmark.BEACON_LOCATION, returnDepth);
|
||||||
|
}
|
||||||
|
|
||||||
returnDepth = Dungeon.depth;
|
returnDepth = Dungeon.depth;
|
||||||
returnBranch = Dungeon.branch;
|
returnBranch = Dungeon.branch;
|
||||||
returnPos = hero.pos;
|
returnPos = hero.pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user