Merge branch 'new-race-mode' into test
This commit is contained in:
@@ -196,9 +196,9 @@ function onBattleEnd() {
|
||||
function onNewRound(msg, prevRound) {
|
||||
showRoundTip.value = true;
|
||||
isFinalShoot.value = msg.current.goldRound;
|
||||
// 决金箭轮每人只射一箭,重置箭数显示为 (0/1)
|
||||
// 决金轮箭数不确定(平局后可能再加一箭),清零 totalShot 隐藏箭数显示
|
||||
if (msg.current.goldRound) {
|
||||
store.updateShotInfo(0, 1);
|
||||
store.updateShotInfo(0, 0);
|
||||
}
|
||||
// 用传入的 prevRound(捕获时刻的旧轮次)展示结算 Tip,与进度条 currentRound 解耦
|
||||
roundTipRound.value = prevRound;
|
||||
@@ -290,10 +290,9 @@ onShow(async () => {
|
||||
} else {
|
||||
if (result.status !== 0) {
|
||||
// 比赛进行中,从后端恢复箭数(测距阶段不展示)
|
||||
if (result.shootNumber) {
|
||||
// current.index 为 0 基的已射箭数(0=尚未射出),与 ShootResult 累加语义一致
|
||||
// 注意:不再 +1,避免重进时与后续 ShootResult 自增形成双重计数导致超出 totalShot
|
||||
store.updateShotInfo(result.current?.index ?? 0, result.shootNumber);
|
||||
// 决金轮不展示箭数;其余轮次使用后端 myIndex 恢复已射箭数
|
||||
if (result.shootNumber && !result.current?.goldRound) {
|
||||
store.updateShotInfo(result.current?.myIndex ?? 0, result.shootNumber);
|
||||
}
|
||||
} else {
|
||||
// 测距阶段重置箭数,防止 ImmediateWatcher 读取 Pinia 保留的旧值
|
||||
|
||||
Reference in New Issue
Block a user