Fix endless battle loop on background quests with battle scenes

This commit is contained in:
Ilya Groshev
2026-05-18 19:52:27 +03:00
parent 42ff8ec88f
commit 8520b67a8b
+8 -1
View File
@@ -24,7 +24,14 @@ func (h *QuestHandler) initQuestState(user *store.UserState, questId int32) {
} }
func isMainQuestPlayable(quest masterdata.EntityMQuest) bool { func isMainQuestPlayable(quest masterdata.EntityMQuest) bool {
return !quest.IsRunInTheBackground && quest.IsCountedAsQuest if quest.IsRunInTheBackground {
// A background quest is still actively played — and must NOT be
// auto-cleared on start — when it carries battle content (a non-zero
// recommended deck power, e.g. quests 500/515/30515). Pure cutscene
// background quests have RecommendedDeckPower == 0.
return quest.RecommendedDeckPower > 0
}
return quest.IsCountedAsQuest
} }
func (h *QuestHandler) clearQuestMissions(user *store.UserState, questId int32, nowMillis int64) { func (h *QuestHandler) clearQuestMissions(user *store.UserState, questId int32, nowMillis int64) {