v3.1.1: fixed cases of landmark entries from beacon not being cleared

This commit is contained in:
Evan Debenham
2025-06-16 13:39:18 -04:00
parent 5c3a865c3c
commit ee6b1f30a2
2 changed files with 6 additions and 0 deletions

View File

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

View File

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