@@ -517,9 +517,9 @@ const getPokestops = async (minLat, maxLat, minLon, maxLon, updated = 0, showPok
517517 }
518518
519519 if ( excludedPokemon . length === 0 ) {
520- excludePokemonSQL = 'OR (quest_pokemon_id IS NOT NULL)' ;
520+ excludePokemonSQL = 'OR (quest_reward_type IS NOT NULL AND quest_reward_type = 7 AND quest_pokemon_id IS NOT NULL)' ;
521521 } else {
522- let sqlExcludeCreate = 'OR (quest_pokemon_id IS NOT NULL AND quest_pokemon_id NOT IN (' ;
522+ let sqlExcludeCreate = 'OR (quest_reward_type IS NOT NULL AND quest_reward_type = 7 AND quest_pokemon_id IS NOT NULL AND quest_pokemon_id NOT IN (' ;
523523 for ( let i = 0 ; i < excludedPokemon . length ; i ++ ) {
524524 if ( i === excludedPokemon . length - 1 ) {
525525 sqlExcludeCreate += '?))' ;
@@ -533,19 +533,17 @@ const getPokestops = async (minLat, maxLat, minLon, maxLon, updated = 0, showPok
533533 }
534534
535535 if ( excludedItems . length === 0 ) {
536- excludeItemSQL = 'OR (quest_item_id IS NOT NULL)' ;
536+ excludeItemSQL = 'OR (quest_reward_type IS NOT NULL AND quest_reward_type = 3 AND quest_item_id IS NOT NULL)' ;
537537 } else {
538- let sqlExcludeCreate = 'OR (( quest_item_id IS NOT NULL AND quest_item_id NOT IN (' ;
538+ excludeItemSQL = 'OR (quest_reward_type IS NOT NULL AND quest_reward_type = 3 AND quest_item_id IS NOT NULL AND quest_item_id NOT IN (' ;
539539 for ( let i = 0 ; i < excludedItems . length ; i ++ ) {
540540 if ( i === excludedItems . length - 1 ) {
541- sqlExcludeCreate += '?) )' ;
541+ excludeItemSQL += '?)' ;
542542 } else {
543- sqlExcludeCreate += '?, ' ;
543+ excludeItemSQL += '?, ' ;
544544 }
545545 args . push ( excludedItems [ i ] ) ;
546546 }
547- excludeItemSQL = sqlExcludeCreate ;
548-
549547 if ( minimumCandyCount > 0 ) {
550548 excludeItemSQL += ' AND (quest_item_id <> 1301 OR JSON_VALUE(quest_rewards, "$[0].info.amount") >= ?)' ;
551549 args . push ( minimumCandyCount ) ;
0 commit comments