Fix quests always showing dungeon IDs

This commit is contained in:
KingRainbow44 2023-04-20 00:26:35 -04:00
parent a53328346a
commit 84c5a76e5d
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -288,21 +288,19 @@ public class GameQuest {
* is the dungeon's scene point. * is the dungeon's scene point.
*/ */
public List<IntIntImmutablePair> getDungeonIds() { public List<IntIntImmutablePair> getDungeonIds() {
var conditions = // Check if this quest is active.
this.getQuestData().getFinishCond().stream() if (this.state != QuestState.UNFINISHED) return List.of();
.filter(cond -> cond.getType() == QuestContent.QUEST_CONTENT_ENTER_DUNGEON)
.toList();
return conditions.stream() return this.getQuestData().getFinishCond().stream()
.map( .filter(cond -> cond.getType() == QuestContent.QUEST_CONTENT_ENTER_DUNGEON)
condition -> { .map(condition -> {
var params = condition.getParam(); var params = condition.getParam();
// The first parameter is the ID of the dungeon. // The first parameter is the ID of the dungeon.
// The second parameter is the dungeon entry's scene point. // The second parameter is the dungeon entry's scene point.
// ex. [1, 1] = dungeon ID 1, scene point 1 or 'KaeyaDungeon'. // ex. [1, 1] = dungeon ID 1, scene point 1 or 'KaeyaDungeon'.
return new IntIntImmutablePair(params[0], params[1]); return new IntIntImmutablePair(params[0], params[1]);
}) })
.toList(); .toList();
} }
public void save() { public void save() {