From 03b642c6988b65a4b184c897ad726304cf16383f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 31 Dec 2024 13:24:40 -0500 Subject: [PATCH] v3.0.0: stone of blink now lets you self-teleport (fixes recall exploit) --- .../items/scrolls/ScrollOfTeleportation.java | 2 +- .../shatteredpixeldungeon/items/stones/StoneOfBlink.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java index a44aeca03..e3766d7f2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java @@ -71,7 +71,7 @@ public class ScrollOfTeleportation extends Scroll { PathFinder.buildDistanceMap(pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null)); if (PathFinder.distance[ch.pos] == Integer.MAX_VALUE || (!Dungeon.level.passable[pos] && !Dungeon.level.avoid[pos]) - || Actor.findChar(pos) != null){ + || (Actor.findChar(pos) != null && Actor.findChar(pos) != ch)){ if (ch == Dungeon.hero){ GLog.w( Messages.get(ScrollOfTeleportation.class, "cant_reach") ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java index 36e4ce7f7..85d64829e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlink.java @@ -21,7 +21,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; @@ -53,8 +52,6 @@ public class StoneOfBlink extends Runestone { @Override protected void activate(int cell) { - if (!ScrollOfTeleportation.teleportToLocation(curUser, cell) && !anonymous){ - Dungeon.level.drop(this, cell).sprite.drop(); - } + ScrollOfTeleportation.teleportToLocation(curUser, cell); } }