fix:比赛射箭数取后端动态值

This commit is contained in:
2026-05-13 14:58:36 +08:00
parent c298e258cc
commit 4761206a6e
2 changed files with 7 additions and 8 deletions

View File

@@ -60,8 +60,8 @@ async function onReceiveMessage(message) {
audioManager.play("比赛结束", false);
} else if (type === MESSAGETYPESV2.ShootResult) {
if (melee.value && current.playerId !== user.value.id) return;
// 仅计用户自己的命中箭,并加上限防护,防止超过 totalShot如重入时 currentShot 初始值偏高)
if (current.playerId === user.value.id && currentShot.value < totalShot.value) currentShot.value++;
// 直接使用后端返回的 myIndex当前用户已射箭数不在前端自增
if (current.playerId === user.value.id) currentShot.value = current.myIndex ?? currentShot.value;
if (message.shootData) {
let key = [];
key.push(