limit by my level highlighter to no more than L8, as portals cannot be higher than this, but players now can

This commit is contained in:
Jon Atkins 2014-05-27 23:57:35 +01:00
parent 79b3782e97
commit 6001285df1

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-highlight-portals-my-level@vita10gy // @id iitc-plugin-highlight-portals-my-level@vita10gy
// @name IITC plugin: highlight portals by my level // @name IITC plugin: highlight portals by my level
// @category Highlighter // @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@ // @version 0.1.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -32,7 +32,10 @@ window.plugin.portalHighlighterPortalsMyLevel.aboveLevel = function(data) {
window.plugin.portalHighlighterPortalsMyLevel.colorLevel = function(below,data) { window.plugin.portalHighlighterPortalsMyLevel.colorLevel = function(below,data) {
var portal_level = data.portal.options.level; var portal_level = data.portal.options.level;
var player_level = PLAYER.level;
// as portal levels can never be higher than L8, clamp the player level to this for highlight purposes
var player_level = Math.min(PLAYER.level,8);
var opacity = .6; var opacity = .6;
if((below && portal_level <= player_level) || if((below && portal_level <= player_level) ||
(!below && portal_level >= player_level)) { (!below && portal_level >= player_level)) {