fix:比赛射箭数取后端动态值
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user