From 27049a4dacc9c1d8a77b98f728a7de360c10cbca Mon Sep 17 00:00:00 2001 From: troytt <47798984@qq.com> Date: Fri, 18 Sep 2026 12:16:34 +0000 Subject: [PATCH] =?UTF-8?q?fix(scene):=20=E4=BC=98=E5=8C=96=20Live=20?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=AF=B7=E6=B1=82=E9=9D=9E=E9=A2=84=E8=AE=BE?= =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=97=B6=E7=9A=84=E8=AF=8A=E6=96=AD=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当用户在 ?live=1 下请求旷野或迷宫关卡(如冰冷之原 Level 3)时,明确提示该关卡无单体 LvlPrest 预设,引导切换至资源包 (Pack) 模式浏览。 TAG=agy CONV=2a1934de-30ef-464e-b3f3-fcbcdbbc49f1 --- src/scene/act-scene.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/scene/act-scene.ts b/src/scene/act-scene.ts index a3004f2..00cd777 100644 --- a/src/scene/act-scene.ts +++ b/src/scene/act-scene.ts @@ -60,7 +60,7 @@ import { RoofFadeController } from '../render/roofs.ts' import { loadCharacterSheet, facingToDirection } from '../game/character.ts' import { loadMonsterAtlas, type LoadedMonsterArt } from '../game/monster-art.ts' import { resolveMonsterArtSpec } from '../game/monster-mapping.ts' -import { ACT_NAMES_ZH, sceneNameZh, variantLabelZh } from '../game/level-names-zh.ts' +import { ACT_NAMES_ZH, LEVEL_NAMES_ZH, sceneNameZh, variantLabelZh } from '../game/level-names-zh.ts' import { GameLoop } from '../sim/loop.ts' import { KeyboardInput } from '../sim/input.ts' import type { SceneEntrance, SceneWarp, SceneWaypoint } from '../game/level-links.ts' @@ -910,9 +910,23 @@ async function loadLiveRuntime( const tables = await loadActTables(archives) const wantedLevel = param('level', '') - const town: LevelInfo = wantedLevel === '' - ? resolveActTown(tables, act) - : resolveLevel(tables, Number(wantedLevel), act) + let town: LevelInfo + try { + town = wantedLevel === '' + ? resolveActTown(tables, act) + : resolveLevel(tables, Number(wantedLevel), act) + } catch (err) { + if (wantedLevel !== '') { + const id = Number(wantedLevel) + const nameZh = LEVEL_NAMES_ZH[id] ?? `关卡 ${wantedLevel}` + throw new Error( + `直读归档 (Live) 模式仅支持预设单体地图(如城镇、大教堂、崔斯特瑞姆等);` + + `${nameZh}(Level ${wantedLevel})属于由 DRLG 动态拼装生成的旷野/迷宫关卡,在 MPQ 中没有单一 DS1 预设(无 LvlPrest 记录)。` + + `请去掉 URL 中的 ?live=1 参数,使用资源包 (Pack) 模式加载完整生成的地图。` + ) + } + throw err + } const wantedVariant = wantedQuadrant || param('variant', '') const variants = town.ds1Names.map(name => name.split('\\').pop() ?? name) let index = 0