v2.1.3: getTransition now gives entrances if it cannot find specifics
This commit is contained in:
@@ -511,6 +511,9 @@ public abstract class Level implements Bundlable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public LevelTransition getTransition(LevelTransition.Type type){
|
public LevelTransition getTransition(LevelTransition.Type type){
|
||||||
|
if (transitions.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (LevelTransition transition : transitions){
|
for (LevelTransition transition : transitions){
|
||||||
//if we don't specify a type, prefer to return any entrance
|
//if we don't specify a type, prefer to return any entrance
|
||||||
if (type == null &&
|
if (type == null &&
|
||||||
@@ -520,7 +523,7 @@ public abstract class Level implements Bundlable {
|
|||||||
return transition;
|
return transition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (type == null && !transitions.isEmpty() ? transitions.get(0) : null);
|
return type != null ? getTransition(null) : transitions.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LevelTransition getTransition(int cell){
|
public LevelTransition getTransition(int cell){
|
||||||
|
|||||||
Reference in New Issue
Block a user