|
|
|
@ -453,14 +453,21 @@ class DBEditor(QMainWindow): |
|
|
|
find_me = lambda x: x[0] == pfic |
|
|
|
target_index = next((i for i, item in enumerate(chain) if find_me(item)), -1) |
|
|
|
base_form_in_generation = None |
|
|
|
for i in range(target_index, -1, -1): |
|
|
|
chain_pfic, chain_name, chain_form_name, method = chain[i] |
|
|
|
chain_pokemon_data = event_system.call_sync('get_pokemon_data', chain_pfic) |
|
|
|
current_pfic = pfic |
|
|
|
while True: |
|
|
|
current_pfic = event_system.call_sync('get_evolution_parent', current_pfic) |
|
|
|
if current_pfic == None: |
|
|
|
base_form_in_generation = current_pfic |
|
|
|
break |
|
|
|
chain_pokemon_data = event_system.call_sync('get_pokemon_data', current_pfic) |
|
|
|
if chain_pokemon_data[3] == pokemon_data[3]: |
|
|
|
base_form_in_generation = chain_pfic |
|
|
|
else: |
|
|
|
base_form_in_generation = current_pfic |
|
|
|
break |
|
|
|
|
|
|
|
if base_form_in_generation: |
|
|
|
self.logger.info(f"Base form in generation for {name} {form_name if form_name else ''} is {base_form_in_generation}") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|