fix bug
This commit is contained in:
@@ -123,13 +123,13 @@ async function renderMap() {
|
||||
// 处理普通地块
|
||||
let tex = getTileTexture(type, x, y)
|
||||
|
||||
// SECT 地块由 renderLargeRegions 渲染,这里跳过
|
||||
if (type === 'SECT') {
|
||||
// Legacy placeholder
|
||||
tex = textures.value['CITY']
|
||||
continue
|
||||
}
|
||||
|
||||
if (!tex) {
|
||||
tex = textures.value['PLAIN']
|
||||
throw new Error(`Missing texture for tile type: ${type} at (${x}, ${y})`)
|
||||
}
|
||||
|
||||
if (!tex) continue
|
||||
|
||||
@@ -142,13 +142,10 @@ export function useTextures() {
|
||||
const tex = await Assets.load(url)
|
||||
textures.value[key] = tex
|
||||
} catch (e) {
|
||||
try {
|
||||
const encodedUrl = `/assets/sects/${encodeURIComponent(`${sectName}_${i}`)}.png`
|
||||
const tex = await Assets.load(encodedUrl)
|
||||
textures.value[key] = tex
|
||||
} catch (e2) {
|
||||
console.warn(`Failed to load sect slice: ${key}`)
|
||||
}
|
||||
// 尝试 URL 编码后加载
|
||||
const encodedUrl = `/assets/sects/${encodeURIComponent(`${sectName}_${i}`)}.png`
|
||||
const tex = await Assets.load(encodedUrl)
|
||||
textures.value[key] = tex
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user