Fix replay flow corrupting the main-flow scene pointer
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled

This commit is contained in:
Ilya Groshev
2026-05-18 13:09:21 +03:00
parent 2cf0c153e1
commit 42ff8ec88f
2 changed files with 10 additions and 2 deletions
+6 -1
View File
@@ -259,7 +259,12 @@ func (h *QuestHandler) HandleQuestFinish(user *store.UserState, questId int32, i
if !isRetired { if !isRetired {
h.applyQuestVictory(user, questId, &outcome, nowMillis, wasReplay) h.applyQuestVictory(user, questId, &outcome, nowMillis, wasReplay)
if isMainQuestPlayable(quest) && !wasMenuReplay { // A replay-flow finish must NOT move the MainFlow scene pointer: the
// finished quest is a replay-variant (30000+) with no chapter, so a
// replay scene left in CurrentQuestSceneId makes the client world map's
// CalculatorWorldMap.GetCurrentSeasonId resolve chapter 0 and NRE. The
// replay's own position is tracked in ReplayFlowCurrentQuestSceneId.
if isMainQuestPlayable(quest) && !wasMenuReplay && !wasReplay {
lastSceneId := h.getLastMainFlowSceneId(questId) lastSceneId := h.getLastMainFlowSceneId(questId)
h.advanceMainFlowScene(user, questId, lastSceneId) h.advanceMainFlowScene(user, questId, lastSceneId)
} }
+4 -1
View File
@@ -233,7 +233,10 @@ func (h *QuestHandler) HandleMainQuestSceneProgress(user *store.UserState, quest
user.MainQuest.CurrentQuestFlowType = int32(model.QuestFlowTypeSubFlow) user.MainQuest.CurrentQuestFlowType = int32(model.QuestFlowTypeSubFlow)
user.MainQuest.ProgressQuestFlowType = int32(model.QuestFlowTypeSubFlow) user.MainQuest.ProgressQuestFlowType = int32(model.QuestFlowTypeSubFlow)
} }
} else { } else if !isReplay {
// Background/non-playable quest: advance the MainFlow pointer — but not
// during a replay, where the isReplay block below tracks the ReplayFlow
// scene and the MainFlow pointer must stay on real main-story progress.
user.MainQuest.CurrentQuestSceneId = questSceneId user.MainQuest.CurrentQuestSceneId = questSceneId
if h.isSceneAhead(questSceneId, user.MainQuest.HeadQuestSceneId) { if h.isSceneAhead(questSceneId, user.MainQuest.HeadQuestSceneId) {
user.MainQuest.HeadQuestSceneId = questSceneId user.MainQuest.HeadQuestSceneId = questSceneId