fix: 修复战斗中 PP 不递减的问题

projectPokemon 读取 maxPp 属性名错误,Showdown 使用小写 maxpp,
导致 maxPp 回退到当前 pp 值,UI 显示的 PP 总是满的。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-24 09:05:46 +08:00
parent c5c7202348
commit a58a36c35a

View File

@@ -274,7 +274,7 @@ function projectPokemon(pkm: any): BattlePokemon {
name: moveName,
type: m.type ?? Dex.moves.get(m.id ?? toID(moveName))?.type?.toLowerCase() ?? 'normal',
pp: m.pp ?? 0,
maxPp: m.maxPp ?? m.pp ?? 0,
maxPp: m.maxpp ?? m.maxPp ?? m.pp ?? 0,
disabled: m.disabled ?? false,
}
}),