靶子组件优化
This commit is contained in:
@@ -321,8 +321,6 @@ async function onReceiveMessage(messages = []) {
|
||||
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
|
||||
if (room.value.battleType === 1) {
|
||||
if (currentShooterId.value !== msg.userId) {
|
||||
scores.value = [];
|
||||
blueScores.value = [];
|
||||
seq.value += 1;
|
||||
currentShooterId.value = msg.userId;
|
||||
if (redTeam.value[0].id === currentShooterId.value) {
|
||||
@@ -341,8 +339,8 @@ async function onReceiveMessage(messages = []) {
|
||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||
if (room.value.battleType === 1) {
|
||||
const isRed = redTeam.value.find((item) => item.id === msg.userId);
|
||||
if (isRed) scores.value = [msg.target];
|
||||
else blueScores.value = [msg.target];
|
||||
if (isRed) scores.value.push(msg.target);
|
||||
else blueScores.value.push(msg.target);
|
||||
if (roundResults.value[currentRound.value - 1]) {
|
||||
if (isRed && roundResults.value[currentRound.value - 1].redArrows) {
|
||||
roundResults.value[currentRound.value - 1].redArrows.push(
|
||||
@@ -551,7 +549,6 @@ onUnmounted(() => {
|
||||
/>
|
||||
<BowTarget
|
||||
:mode="room.battleType ? 'team' : 'solo'"
|
||||
:showE="start && user.id === currentShooterId"
|
||||
:power="start ? power : 0"
|
||||
:currentRound="currentRound"
|
||||
:totalRound="totalRounds"
|
||||
|
||||
Reference in New Issue
Block a user