mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Fix replay flow corrupting the main-flow scene pointer
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:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user