Scope genlocke retireHoF to HoF team instead of all alive Pokemon
advance_leg() now checks current_run.hof_encounter_ids first and only retires those Pokemon and their families. Falls back to all alive non-shiny Pokemon when no HoF team is selected (backwards compatible). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
# nuzlocke-tracker-h3fw
|
# nuzlocke-tracker-h3fw
|
||||||
title: Use HoF team for genlocke retirement instead of all alive Pokemon
|
title: Use HoF team for genlocke retirement instead of all alive Pokemon
|
||||||
status: todo
|
status: in-progress
|
||||||
type: task
|
type: task
|
||||||
priority: normal
|
priority: normal
|
||||||
created_at: 2026-02-09T09:15:00Z
|
created_at: 2026-02-09T09:15:00Z
|
||||||
updated_at: 2026-02-09T09:15:03Z
|
updated_at: 2026-02-09T09:26:16Z
|
||||||
parent: nuzlocke-tracker-8w9s
|
parent: nuzlocke-tracker-8w9s
|
||||||
blocking:
|
blocking:
|
||||||
- nuzlocke-tracker-25mh
|
- nuzlocke-tracker-25mh
|
||||||
@@ -36,5 +36,5 @@ select(Encounter.pokemon_id).where(
|
|||||||
- Update the frontend `RunEncounters.tsx` to also scope `retiredPokemonIds` correctly (no change needed — it reads from the backend response)
|
- Update the frontend `RunEncounters.tsx` to also scope `retiredPokemonIds` correctly (no change needed — it reads from the backend response)
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
- [ ] Update `advance_leg()` to prefer `hof_encounter_ids` over all-alive query
|
- [x] Update `advance_leg()` to prefer `hof_encounter_ids` over all-alive query
|
||||||
- [ ] Verify backwards compatibility when `hof_encounter_ids` is null
|
- [x] Verify backwards compatibility when `hof_encounter_ids` is null
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
# nuzlocke-tracker-lqf2
|
||||||
|
title: Fix hooks order violation in RunEncounters
|
||||||
|
status: completed
|
||||||
|
type: bug
|
||||||
|
priority: critical
|
||||||
|
created_at: 2026-02-09T09:22:14Z
|
||||||
|
updated_at: 2026-02-09T09:22:58Z
|
||||||
|
---
|
||||||
|
|
||||||
|
The hofTeam useMemo was placed after early returns, causing a 'Rendered more hooks than during the previous render' error and blank page.
|
||||||
@@ -146,8 +146,15 @@ async def advance_leg(
|
|||||||
|
|
||||||
# Compute retired Pokemon families if retireHoF is enabled
|
# Compute retired Pokemon families if retireHoF is enabled
|
||||||
if genlocke.genlocke_rules.get("retireHoF", False):
|
if genlocke.genlocke_rules.get("retireHoF", False):
|
||||||
# Query surviving caught Pokemon from the completed run
|
# Prefer the player's HoF team selection; fall back to all alive
|
||||||
# "Surviving HoF" = caught, not fainted, not shiny
|
if current_run.hof_encounter_ids:
|
||||||
|
survivors_result = await session.execute(
|
||||||
|
select(Encounter.pokemon_id).where(
|
||||||
|
Encounter.id.in_(current_run.hof_encounter_ids),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# Fallback: all surviving caught, non-shiny Pokemon
|
||||||
survivors_result = await session.execute(
|
survivors_result = await session.execute(
|
||||||
select(Encounter.pokemon_id).where(
|
select(Encounter.pokemon_id).where(
|
||||||
Encounter.run_id == current_leg.run_id,
|
Encounter.run_id == current_leg.run_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user