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
Fix Excluded By Rarity to work with new Dynamic Rarity changes #2489
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failing Travis.
/home/travis/build/RocketMap/RocketMap/static/js/map.js
2844:29 error 'pokemonRarities' is not defined no-undef
2845:32 error 'pokemonRarities' is not defined no-undef
2846:50 error 'pokemonRarities' is not defined no-undef
2850:13 error Closing curly brace does not appear on the same line as the subsequent block brace-style
…m to excludedPokemonByRarity excludedPokemon is now used as a global list of excluded Pokemon, made up of any number of individual exclusion lists (rarity and hidden, for now) In accordance with the above two points, refactored all code that controls excluding Pokemon, including adding new functions to help add/remove from list Fixes Issue RocketMap#2470 Signed-off-by: trunksbomb <trunskbomb@msn.com>
Still says a curly bracket at line 2850 doesn't end on the same block, but it does. Also that pokemonRarities isn't defined, but it is, just in map.common.js Signed-off-by: trunksbomb <trunskbomb@msn.com>
efb3916
to
58092b2
Compare
Author is unresponsive, so I rebased and pushed a fix for Travis. Note: this doesn't serve as my review or approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working like it should.
Set rarity update to 1 minute and it execluded the updated mons like it should do. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks to do the job to me, I can mix exclude by rarity and exclude by pokemon filter
excludedPokemon is now used as a global list of excluded Pokemon, made up of any number of individual exclusion lists (rarity and hidden, for now)
In accordance with the above two points, refactored all code that controls excluding Pokemon, including adding new functions to help add/remove from list
Fixes Issue #2470
Description
Exclude By Rarity was introduced prior to the Dynamic Rarities change, which changed the way the excluded Pokemon list was sent to the server. This change broke Exclude By Rarity as described in Issue #2470 because the excluded Pokemon by rarity were not sent to the server and so the server sent back the entire list of nearby Pokemon.
Additionally, this PR sets the stage for additional exclusion lists to be easily implemented (such as by generation, or by weather boosted, etc).
Motivation and Context
Fixes issue #2470
New functions abstract excluding/including away from the main logic of decided what to exclude/include.
Moving forward, it should be easier to integrate new exclusion lists.
How Has This Been Tested?
Tested on my live city map. Can switch between all rarity tiers reliably (although reducing the rarity filter doesn't repopulate quickly, moving the map will cause an update to reinclude Pokemon) and exclude/include individual Pokemon.
Map still loads all visible Pokemon on initial load, which can be a lot if clustering is disabled, because the first fetch request goes out before the rarity filter is processed.
Screenshots (if appropriate):
Types of changes
Checklist: