v1.1.0: fixed immovable characters being able to be tele'd in some cases

This commit is contained in:
Evan Debenham 2021-10-16 14:47:58 -04:00
parent a6097190d3
commit a2fcd04768

View File

@ -97,6 +97,11 @@ public class ScrollOfTeleportation extends Scroll {
return teleportInNonRegularLevel( ch, false );
}
if (Char.hasProp(ch, Char.Property.IMMOVABLE)){
GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") );
return false;
}
int count = 20;
int pos;
do {
@ -204,6 +209,11 @@ public class ScrollOfTeleportation extends Scroll {
//prefers not seen(optional) > not visible > visible
public static boolean teleportInNonRegularLevel(Char ch, boolean preferNotSeen ){
if (Char.hasProp(ch, Char.Property.IMMOVABLE)){
GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") );
return false;
}
ArrayList<Integer> visibleValid = new ArrayList<>();
ArrayList<Integer> notVisibleValid = new ArrayList<>();
ArrayList<Integer> notSeenValid = new ArrayList<>();