Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level 1 portals show incorrect "resonator level(s) needed for next portal level" #734

Open
Artoria2e5 opened this issue May 17, 2024 · 3 comments

Comments

@Artoria2e5
Copy link

I have a portal that's level 1 from a single level 5 resonator. It should require 11 more resonator levels to become level 2. However, IITC says 8, probably because it doesn't quite understand how level 1 works differently from all other levels:

Screenshot from 2024-05-17 23-08-44

@Artoria2e5
Copy link
Author

Specifically,

window.getPortalLevel = function(d) {
applies a minimum clamp to the level, so that it does not return a number less than 1 when there's a resonator. However,
levelDetails = getPortalLevel(details);
naively treats the detailed level as total level / 8.

@Artoria2e5
Copy link
Author

Artoria2e5 commented May 17, 2024

Considering that the only references to getPortalLevel in this whole organization are:

  • a deprecated.js
  • this portal_detail_display.js
  • portal_info.js, getPortalRange()

I'd think we can get away with removing the Math.max() in getPortalLevel. The only place where the max makes sense is in getPortalRange() -- we can just put it there!

@McBen
Copy link
Contributor

McBen commented May 17, 2024

and

window.getPortalSummaryData = function(d) {
// NOTE: the summary data reports unclaimed portals as level 1 - not zero as elsewhere in IITC
var level = parseInt(getPortalLevel(d));
if (level == 0) level = 1; //niantic returns neutral portals as level 1, not 0 as used throughout IITC elsewhere

it would handle the "without max" case, but makes the comments invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants