mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Fix menu pick black screen for quests without a difficulty relation
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -34,7 +34,6 @@ type QuestCatalog struct {
|
|||||||
TutorialUnlockConditions []EntityMTutorialUnlockCondition
|
TutorialUnlockConditions []EntityMTutorialUnlockCondition
|
||||||
ChapterLastSceneByQuestId map[int32]int32
|
ChapterLastSceneByQuestId map[int32]int32
|
||||||
SeasonIdByRouteId map[int32]int32
|
SeasonIdByRouteId map[int32]int32
|
||||||
QuestsWithDifficulty map[int32]bool // any questId referenced in m_quest_relation_main_flow
|
|
||||||
BattleOnlyTargetSceneByQuestId map[int32]int32
|
BattleOnlyTargetSceneByQuestId map[int32]int32
|
||||||
|
|
||||||
UserExpThresholds []int32
|
UserExpThresholds []int32
|
||||||
@@ -240,21 +239,6 @@ func LoadQuestCatalog(partsCatalog *PartsCatalog) (*QuestCatalog, error) {
|
|||||||
return nil, fmt.Errorf("load tutorial unlock condition table: %w", err)
|
return nil, fmt.Errorf("load tutorial unlock condition table: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
relations, err := utils.ReadTable[EntityMQuestRelationMainFlow]("m_quest_relation_main_flow")
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("load quest relation main flow table: %w", err)
|
|
||||||
}
|
|
||||||
questsWithDifficulty := make(map[int32]bool, len(relations)*3)
|
|
||||||
for _, r := range relations {
|
|
||||||
questsWithDifficulty[r.MainFlowQuestId] = true
|
|
||||||
if r.ReplayFlowQuestId != 0 {
|
|
||||||
questsWithDifficulty[r.ReplayFlowQuestId] = true
|
|
||||||
}
|
|
||||||
if r.SubFlowQuestId != 0 {
|
|
||||||
questsWithDifficulty[r.SubFlowQuestId] = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
battleOnlyTargetSceneByQuestId := make(map[int32]int32)
|
battleOnlyTargetSceneByQuestId := make(map[int32]int32)
|
||||||
for _, scene := range scenes {
|
for _, scene := range scenes {
|
||||||
if scene.IsBattleOnlyTarget {
|
if scene.IsBattleOnlyTarget {
|
||||||
@@ -555,7 +539,6 @@ func LoadQuestCatalog(partsCatalog *PartsCatalog) (*QuestCatalog, error) {
|
|||||||
TutorialUnlockConditions: tutorialUnlockConds,
|
TutorialUnlockConditions: tutorialUnlockConds,
|
||||||
ChapterLastSceneByQuestId: chapterLastSceneByQuestId,
|
ChapterLastSceneByQuestId: chapterLastSceneByQuestId,
|
||||||
SeasonIdByRouteId: seasonIdByRouteId,
|
SeasonIdByRouteId: seasonIdByRouteId,
|
||||||
QuestsWithDifficulty: questsWithDifficulty,
|
|
||||||
BattleOnlyTargetSceneByQuestId: battleOnlyTargetSceneByQuestId,
|
BattleOnlyTargetSceneByQuestId: battleOnlyTargetSceneByQuestId,
|
||||||
|
|
||||||
UserExpThresholds: BuildExpThresholds(paramMapRows, 1),
|
UserExpThresholds: BuildExpThresholds(paramMapRows, 1),
|
||||||
@@ -579,6 +562,3 @@ func (q *QuestCatalog) BattleOnlyTargetSceneIdFor(questId int32) (int32, bool) {
|
|||||||
return v, ok
|
return v, ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *QuestCatalog) QuestHasDifficulty(questId int32) bool {
|
|
||||||
return q.QuestsWithDifficulty[questId]
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func (h *QuestHandler) handleQuestStartInternal(user *store.UserState, questId i
|
|||||||
questState.UserDeckNumber = userDeckNumber
|
questState.UserDeckNumber = userDeckNumber
|
||||||
|
|
||||||
isCleared := questState.QuestStateType == model.UserQuestStateTypeCleared
|
isCleared := questState.QuestStateType == model.UserQuestStateTypeCleared
|
||||||
isMenuPick := !isReplayFlow && !isMainFlow && (isCleared || h.QuestHasDifficulty(questId))
|
isMenuPick := !isReplayFlow && !isMainFlow
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case isMenuPick:
|
case isMenuPick:
|
||||||
|
|||||||
Reference in New Issue
Block a user