BUG修复

This commit is contained in:
kron
2025-08-18 16:09:11 +08:00
parent b31689b19f
commit 1ce2ea9eb7
13 changed files with 302 additions and 166 deletions

View File

@@ -268,10 +268,8 @@ export const getGameAPI = async (battleId) => {
data.redPlayers = {};
data.bluePlayers = {};
data.mvps = [];
data.goldenRound =
goldenRoundRecords && goldenRoundRecords.length
? goldenRoundRecords[0]
: null;
data.goldenRounds =
goldenRoundRecords && goldenRoundRecords.length ? goldenRoundRecords : [];
playerStats.forEach((item) => {
const { playerBattleStats = {}, roundRecords = [] } = item;
if (playerBattleStats.team === 0) {
@@ -290,6 +288,20 @@ export const getGameAPI = async (battleId) => {
};
});
});
(goldenRoundRecords || []).forEach((item, index) => {
item.arrowHistory.forEach((arrow) => {
if (!data.roundsData[playerStats.length + index + 1]) {
data.roundsData[playerStats.length + index + 1] = {};
}
if (!data.roundsData[playerStats.length + index + 1][arrow.playerId]) {
data.roundsData[playerStats.length + index + 1][arrow.playerId] = [];
}
data.roundsData[playerStats.length + index + 1][arrow.playerId].push(
arrow
);
});
});
data.mvps.sort((a, b) => b.totalRings - a.totalRings);
}
if (battleStats && battleStats.mode === 2) {