Skip to content

Commit 3d543ad

Browse files
authoredMay 7, 2024··
Include anubis in images.
Update playerstats to match based on team string if team id does not exist.
1 parent 7e5df69 commit 3d543ad

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed
 

‎public/img/maps/de_anubis.jpg

2.15 MB
Loading

‎src/components/PlayerStatTable.vue

+18-8
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,10 @@ export default {
251251
if (typeof serverResponse == "string") return;
252252
let allMapIds = [];
253253
let totalMatchTeam = [];
254-
let allTeamIds = [];
254+
let allTeamNames = [];
255255
serverResponse.filter(item => {
256256
let i = allMapIds.findIndex(x => x == item.map_id);
257-
let j = allTeamIds.findIndex(x => x == item.team_id);
258257
if (i <= -1) allMapIds.push(item.map_id);
259-
if (j <= -1) allTeamIds.push(item.team_id);
260258
return null;
261259
});
262260
allMapIds.forEach(map_id => {
@@ -284,11 +282,23 @@ export default {
284282
let hsp = this.GetHSP(player);
285283
let kdr = this.GetKDR(player);
286284
let fpr = this.GetFPR(player);
287-
let teamNum = player.team_id == matchData.team1_id ? 1 : 2;
288-
let newName =
289-
player.team_id == matchData.team1_id
290-
? matchData.team1_string
291-
: matchData.team2_string;
285+
let teamNum;
286+
let newName;
287+
if (player.team_id) {
288+
teamNum = player.team_id == matchData.team1_id ? 1 : 2;
289+
newName =
290+
player.team_id == matchData.team1_id
291+
? matchData.team1_string
292+
: matchData.team2_string;
293+
} else {
294+
// If we don't have a team ID, we must be pugging. Go based on
295+
// Team strings alone.
296+
teamNum = player.team_name == matchData.team1_string ? 1 : 2;
297+
newName =
298+
player.team_name == matchData.team1_string
299+
? matchData.team1_string
300+
: matchData.team2_string;
301+
}
292302
this.$set(
293303
this.playerstats[idx][pIdx],
294304
"Team",

0 commit comments

Comments
 (0)
Please sign in to comment.