From c7013cfa7ad99444163ff58512b5dff25bc85713 Mon Sep 17 00:00:00 2001 From: Ash Ketchum Date: Wed, 15 Jul 2026 10:47:08 +0200 Subject: fix(nowild): use wUnusedFlag (0xCC5B) instead of wc5d8 for the toggle wc5d8 looked unused but the game writes it via computed addresses (observed it change 56->44->35 while walking/warping), so the NOWILD flag got clobbered and encounters still happened. wUnusedFlag is a genuine unused WRAM0 byte (verified stable at 0 through walking + warping, not in the save block so it defaults off each boot). NOWILD flag now persists reliably. --- engine/battle/wild_encounters.asm | 2 +- engine/slop_menu.asm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engine') diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 6e29dd4c..da0097c9 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -1,7 +1,7 @@ ; try to initiate a wild pokemon encounter ; returns success in Z TryDoWildEncounter: - ld a, [wSlopNoWild] ; SL0P no-wild-encounters toggle + ld a, [wUnusedFlag] ; SL0P no-wild-encounters toggle and a jr nz, .CantEncounter ld a, [wNPCMovementScriptPointerTableNum] diff --git a/engine/slop_menu.asm b/engine/slop_menu.asm index 7cb779a2..38c5bdcf 100644 --- a/engine/slop_menu.asm +++ b/engine/slop_menu.asm @@ -33,7 +33,7 @@ SlopMenu:: ld de, SlopMenuText call PlaceString ; ON marker for the NOWILD toggle (item 10 -> row 13) - ld a, [wSlopNoWild] + ld a, [wUnusedFlag] and a jr z, .nowildOff hlcoord 13, 13 @@ -394,9 +394,9 @@ SlopMaxCoins: ; NOWILD toggle: no wild encounters (hooked in TryDoWildEncounter) SlopToggleNoWild: - ld a, [wSlopNoWild] + ld a, [wUnusedFlag] xor $01 - ld [wSlopNoWild], a + ld [wUnusedFlag], a and a ret -- cgit v1.3.1-sl0p