v2.2.1: fixed level load failsafe logic wrongly triggering in new quest
This commit is contained in:
@@ -448,13 +448,17 @@ public class Dungeon {
|
||||
}
|
||||
|
||||
public static void switchLevel( final Level level, int pos ) {
|
||||
|
||||
|
||||
//Position of -2 specifically means trying to place the hero the exit
|
||||
if (pos == -2){
|
||||
LevelTransition t = level.getTransition(LevelTransition.Type.REGULAR_EXIT);
|
||||
if (t != null) pos = t.cell();
|
||||
}
|
||||
|
||||
if (pos < 0 || pos >= level.length() || (!level.passable[pos] && !level.avoid[pos])){
|
||||
//Place hero at the entrance if they are out of the map (often used for pox = -1)
|
||||
// or if they are in solid terrain (except in the mining level, where that happens normally)
|
||||
if (pos < 0 || pos >= level.length()
|
||||
|| (!(level instanceof MiningLevel) && !level.passable[pos] && !level.avoid[pos])){
|
||||
pos = level.getTransition(null).cell();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user