Skip to content

Commit 1cb8ef6

Browse files
authored
Merge pull request #264 from Mygod/update-masterfile
Update masterfile
2 parents f09b16a + 6fab4e3 commit 1cb8ef6

File tree

10 files changed

+4179
-6222
lines changed

10 files changed

+4179
-6222
lines changed

docs/configuration/config.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ Anything you do not include will use the `default.json` as a fallback. When view
5555
```js
5656
// Map settings
5757
"map": {
58-
// Maximum available Pokemon
59-
"maxPokemonId": 649,
6058
// Map start location latitude
6159
"startLat": 0,
6260
// Map start location longitude

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/configs/default.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"startZoom": 12,
2929
"minZoom": 10,
3030
"maxZoom": 18,
31-
"maxPokemonId": 649,
32-
"minPvpCp": {
31+
"minPvpCp": {
3332
"great": 1400,
3433
"ultra": 2400
3534
},

src/data/default.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const data = require('../../static/locales/' + config.locale + '.json');
55
data.title = config.title;
66
data.header_title = config.headerTitle;
77
data.locale = config.locale;
8-
data.max_pokemon_id = config.map.maxPokemonId; // TODO: Fix, no idea why index.js isn't picking up max_pokemon_id anymore
9-
data.pokemon_count = config.map.maxPokemonId;
108
data.google_analytics_id = config.google.analytics;
119
data.google_adsense_id = config.google.adsense;
1210
data.cluster_pokemon = config.map.clusters.pokemon;

src/data/map.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const getPokemon = async (minLat, maxLat, minLon, maxLon, showPVP, showIV, updat
2727
if (split.length === 2) {
2828
const pokemonId = parseInt(split[0]);
2929
const formId = parseInt(split[1]);
30-
if ((masterfile.pokemon[pokemonId] || {}).default_form_id === split[1]) {
30+
if ((masterfile.pokemon[pokemonId] || {}).default_form_id === formId) {
3131
pokemonLookup[pokemonId] = false;
3232
}
3333
formLookup[formId] = false;
@@ -56,7 +56,7 @@ const getPokemon = async (minLat, maxLat, minLon, maxLon, showPVP, showIV, updat
5656
if (split.length === 2) {
5757
const pokemonId = parseInt(split[0]);
5858
const formId = parseInt(split[1]);
59-
if ((masterfile.pokemon[pokemonId] || {}).default_form_id === split[1]) {
59+
if ((masterfile.pokemon[pokemonId] || {}).default_form_id === formId) {
6060
pokemonLookup[pokemonId] = jsFilter;
6161
}
6262
formLookup[formId] = jsFilter;
@@ -179,7 +179,7 @@ const getGyms = async (minLat, maxLat, minLon, maxLon, updated = 0, showRaids =
179179
excludePokemonIds.push(pokemonId);
180180
} else {
181181
excludeFormIds.push(formId);
182-
if ((masterfile.pokemon[pokemonId] || {}).default_form_id === split[1]) {
182+
if ((masterfile.pokemon[pokemonId] || {}).default_form_id === formId) {
183183
excludePokemonIds.push(pokemonId);
184184
}
185185
}

src/routes/api.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const i18n = require('i18n');
44
const express = require('express');
55
const router = express.Router();
66

7-
const config = require('../services/config.js');
87
const map = require('../data/map.js');
98
const utils = require('../services/utils.js');
109

@@ -343,8 +342,7 @@ const getData = async (perms, filter) => {
343342
'types': null
344343
});
345344

346-
for (let i = 1; i < config.map.maxPokemonId; i++) {
347-
const pkmn = masterfile.pokemon[i];
345+
for (const [i, pkmn] of Object.entries(masterfile.pokemon)) {
348346
const forms = Object.keys(pkmn.forms);
349347
for (let j = 0; j < forms.length; j++) {
350348
const formId = forms[j];

src/routes/ui.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ const handlePage = async (req, res) => {
7373
data.bodyClass = config.style === 'dark' ? 'theme-dark' : '';
7474
data.tableClass = config.style === 'dark' ? 'table-dark' : '';
7575

76-
data.max_pokemon_id = config.map.maxPokemonId;
77-
7876
// Build available tile servers list
7977
const tileservers = getAvailableTileservers();
8078
data.available_tileservers_json = JSON.stringify(tileservers);

src/views/index.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
const scoutingUrl = '{{{scouting_url}}}';
1717
const scoutMaxCount = parseInt('{{scouting_count}}' || 15);
1818
19-
const maxPokemonId = '{{pokemon_count}}'; // Bandaid
20-
2119
const defaultShowPokemon = '{{default_show_pokemon}}' === 'true';
2220
const defaultShowPokemonTimers = '{{default_show_pokemon_timers}}' === 'true';
2321
const defaultShowRaids = '{{default_show_raids}}' === 'true';

0 commit comments

Comments
 (0)