🌍 Refactor regional form check logic for better readability and clarity in gamemaster utility function
This commit is contained in:
@@ -48,13 +48,13 @@ export function breakUpGamemaster(gamemaster) {
|
||||
acc.pokemonAllForms.push(item);
|
||||
|
||||
// Add to pokemon (filtered - first occurrence OR regional forms)
|
||||
if (
|
||||
!acc.pokemonSeen.has(pokemonId) ||
|
||||
(acc.pokemonSeen.has(pokemonId) &&
|
||||
regionCheck.includes(
|
||||
pokemonSettings?.form?.split('_')[1]?.toLowerCase()
|
||||
))
|
||||
) {
|
||||
// Check if this is a regional form by looking at the form string
|
||||
const form = pokemonSettings?.form;
|
||||
const isRegionalForm = form ? regionCheck.includes(
|
||||
form.split('_')[1]?.toLowerCase()
|
||||
) : false;
|
||||
|
||||
if (!acc.pokemonSeen.has(pokemonId) || (acc.pokemonSeen.has(pokemonId) && isRegionalForm)) {
|
||||
acc.pokemonSeen.add(pokemonId);
|
||||
acc.pokemon.push(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user