Merge pull request #144 from wrycta/master

Bugfix to ipas-link plugin for the case of missing resonators on the portal
This commit is contained in:
Jon Atkins 2013-04-11 08:42:17 -07:00
commit f80c30cf36

View File

@ -33,7 +33,12 @@ window.plugin.ipasLink.addLink = function(d) {
window.plugin.ipasLink.getHash = function(d) {
var hashParts=[];
$.each(d.resonatorArray.resonators, function(ind, reso) {
hashParts.push(reso.level + "," + reso.distanceToPortal + "," + reso.energyTotal);
if ($reso) {
hashParts.push(reso.level + "," + reso.distanceToPortal + "," + reso.energyTotal);
} else {
hashParts.push(1 + "," + 35 + "," + 0); // Dummy values, the only important one is energy=0
}
}
});
return hashParts.join(";")+"|" + "0,0,0,0"; //shields not implemented yet
}