Handle Dungeons with null config (#2279)

This commit is contained in:
Nazrin
2023-07-31 09:52:42 -07:00
committed by GitHub
parent 4320bc7d29
commit 465582b8da
2 changed files with 10 additions and 3 deletions

View File

@@ -53,8 +53,13 @@ public final class DungeonManager {
public DungeonManager(@NonNull Scene scene, @NonNull DungeonData dungeonData) {
this.scene = scene;
this.dungeonData = dungeonData;
this.passConfigData = GameData.getDungeonPassConfigDataMap().get(dungeonData.getPassCond());
this.finishedConditions = new int[passConfigData.getConds().size()];
if(dungeonData.getPassCond() == 0){
this.passConfigData = new DungeonPassConfigData();
this.passConfigData.setConds(new ArrayList<>());
}else {
this.passConfigData = GameData.getDungeonPassConfigDataMap().get(dungeonData.getPassCond());
}
this.finishedConditions = new int[this.passConfigData.getConds().size()];
}
public void triggerEvent(DungeonPassConditionType conditionType, int... params) {
@@ -76,6 +81,7 @@ public final class DungeonManager {
}
public boolean isFinishedSuccessfully() {
if(passConfigData.getLogicType()==null) return false;
return LogicType.calculate(passConfigData.getLogicType(), finishedConditions);
}