3cf83ed6-dca1-44be-bf7a-a27d19337739
This commit is contained in:
@@ -925,8 +925,9 @@ export const useGameStore = create<Store>()(
|
||||
};
|
||||
const newLog = [logEntry, ...s.expeditionLog].slice(0, 30);
|
||||
|
||||
// v0.10 工单 #2 修复:探险结束时立即清空 activeExpedition,避免 finished 状态卡死
|
||||
// 保留 lastExpeditionSummary 用于入口展示「上次结果」
|
||||
if (result.ended) {
|
||||
// 探险结束(胜利或失败)
|
||||
exp.finished = true;
|
||||
}
|
||||
|
||||
@@ -988,7 +989,8 @@ export const useGameStore = create<Store>()(
|
||||
}
|
||||
|
||||
set({
|
||||
activeExpedition: exp,
|
||||
// v0.10 工单 #2 修复:探险结束立即清空 activeExpedition,让玩家无障碍再出发
|
||||
activeExpedition: result.ended ? null : exp,
|
||||
crystals: newCrystals,
|
||||
insights: newInsights,
|
||||
contact: newContact,
|
||||
@@ -1028,7 +1030,6 @@ export const useGameStore = create<Store>()(
|
||||
const s = get();
|
||||
if (!s.activeExpedition) return;
|
||||
const exp = JSON.parse(JSON.stringify(s.activeExpedition));
|
||||
exp.finished = true;
|
||||
const logEntry = {
|
||||
expeditionId: exp.id,
|
||||
nodeType: "rest" as const,
|
||||
@@ -1044,7 +1045,8 @@ export const useGameStore = create<Store>()(
|
||||
finishedAt: Date.now(),
|
||||
};
|
||||
set({
|
||||
activeExpedition: exp,
|
||||
// v0.10 工单 #2 修复:撤退立即清空 activeExpedition,避免 finished 卡死
|
||||
activeExpedition: null,
|
||||
expeditionLog: [logEntry, ...s.expeditionLog].slice(0, 30),
|
||||
lastExpeditionSummary: summary,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user