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