🌍 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);
|
acc.pokemonAllForms.push(item);
|
||||||
|
|
||||||
// Add to pokemon (filtered - first occurrence OR regional forms)
|
// Add to pokemon (filtered - first occurrence OR regional forms)
|
||||||
if (
|
// Check if this is a regional form by looking at the form string
|
||||||
!acc.pokemonSeen.has(pokemonId) ||
|
const form = pokemonSettings?.form;
|
||||||
(acc.pokemonSeen.has(pokemonId) &&
|
const isRegionalForm = form ? regionCheck.includes(
|
||||||
regionCheck.includes(
|
form.split('_')[1]?.toLowerCase()
|
||||||
pokemonSettings?.form?.split('_')[1]?.toLowerCase()
|
) : false;
|
||||||
))
|
|
||||||
) {
|
if (!acc.pokemonSeen.has(pokemonId) || (acc.pokemonSeen.has(pokemonId) && isRegionalForm)) {
|
||||||
acc.pokemonSeen.add(pokemonId);
|
acc.pokemonSeen.add(pokemonId);
|
||||||
acc.pokemon.push(item);
|
acc.pokemon.push(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user