Scoreboard Fix
Links don't always seem to have creators anymore, for some reason.
This commit is contained in:
parent
e3d6b135ce
commit
7a41d60d20
@ -69,7 +69,6 @@ window.plugin.scoreboard.compileStats = function() {
|
|||||||
|
|
||||||
var team = getTeam(val.options.data);
|
var team = getTeam(val.options.data);
|
||||||
var player = val.options.data.creator.creatorGuid;
|
var player = val.options.data.creator.creatorGuid;
|
||||||
|
|
||||||
window.plugin.scoreboard.initPlayer(player,team);
|
window.plugin.scoreboard.initPlayer(player,team);
|
||||||
|
|
||||||
// Google sends fields long since dead in the data. This makes sure it's still actually up.
|
// Google sends fields long since dead in the data. This makes sure it's still actually up.
|
||||||
@ -109,29 +108,30 @@ window.plugin.scoreboard.compileStats = function() {
|
|||||||
$.each(window.links, function(qk, link) {
|
$.each(window.links, function(qk, link) {
|
||||||
somethingInView = true;
|
somethingInView = true;
|
||||||
var team = getTeam(link.options.data);
|
var team = getTeam(link.options.data);
|
||||||
var player = link.options.data.creator.creatorGuid;
|
if(link.options.data.creator !== undefined) {
|
||||||
window.plugin.scoreboard.initPlayer(player, team);
|
var player = link.options.data.creator.creatorGuid;
|
||||||
scores['team'][team]['count_links']++;
|
window.plugin.scoreboard.initPlayer(player, team);
|
||||||
scores['player'][player]['count_links']++;
|
scores['team'][team]['count_links']++;
|
||||||
|
scores['player'][player]['count_links']++;
|
||||||
var linkLength = window.plugin.scoreboard.portalDistance(link.options.data.edge.destinationPortalLocation,link.options.data.edge.originPortalLocation);
|
|
||||||
scores['team'][team]['link_length'] += linkLength;
|
var linkLength = window.plugin.scoreboard.portalDistance(link.options.data.edge.destinationPortalLocation,link.options.data.edge.originPortalLocation);
|
||||||
scores['player'][player]['link_length'] += linkLength;
|
scores['team'][team]['link_length'] += linkLength;
|
||||||
|
scores['player'][player]['link_length'] += linkLength;
|
||||||
var largestLink = scores['team'][team]['largest']['link'];
|
|
||||||
if(largestLink === undefined || largestLink.distance < linkLength) {
|
var largestLink = scores['team'][team]['largest']['link'];
|
||||||
largestLink = {};
|
if(largestLink === undefined || largestLink.distance < linkLength) {
|
||||||
largestLink.distance = linkLength;
|
largestLink = {};
|
||||||
largestLink.player = player;
|
largestLink.distance = linkLength;
|
||||||
|
largestLink.player = player;
|
||||||
|
}
|
||||||
|
scores['team'][team]['largest']['link'] = largestLink;
|
||||||
|
|
||||||
|
//var largestLink = scores['player'][player]['largest']['link'];
|
||||||
|
//if(largestLink === undefined || largestLink < linkLength) {
|
||||||
|
// largestLink = linkLength;
|
||||||
|
//}
|
||||||
|
//scores['player'][player]['largest']['link'] = largestLink;
|
||||||
}
|
}
|
||||||
scores['team'][team]['largest']['link'] = largestLink;
|
|
||||||
|
|
||||||
//var largestLink = scores['player'][player]['largest']['link'];
|
|
||||||
//if(largestLink === undefined || largestLink < linkLength) {
|
|
||||||
// largestLink = linkLength;
|
|
||||||
//}
|
|
||||||
//scores['player'][player]['largest']['link'] = largestLink;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$.each(window.portals, function(qk, portal) {
|
$.each(window.portals, function(qk, portal) {
|
||||||
somethingInView = true;
|
somethingInView = true;
|
||||||
@ -204,6 +204,7 @@ window.plugin.scoreboard.fieldInfo = function(field) {
|
|||||||
+ window.digits(field.options.data.entityScore.entityScore)
|
+ window.digits(field.options.data.entityScore.entityScore)
|
||||||
+ ' - ' + window.getPlayerName(field.options.data.creator.creatorGuid)
|
+ ' - ' + window.getPlayerName(field.options.data.creator.creatorGuid)
|
||||||
+ '</div>';
|
+ '</div>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
retVal = 'N/A';
|
retVal = 'N/A';
|
||||||
}
|
}
|
||||||
@ -224,6 +225,7 @@ window.plugin.scoreboard.fieldInfoArea = function(field) {
|
|||||||
+ window.digits(Math.round(field.options.data.fieldArea))
|
+ window.digits(Math.round(field.options.data.fieldArea))
|
||||||
+ ' - ' + window.getPlayerName(field.options.data.creator.creatorGuid)
|
+ ' - ' + window.getPlayerName(field.options.data.creator.creatorGuid)
|
||||||
+ '</div>';
|
+ '</div>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
retVal = 'N/A';
|
retVal = 'N/A';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user