Skip to content

Fishing Bait Array Fix - #212

Merged
Adubbz merged 1 commit into
TheMoonPeople:masterfrom
SirFancyBacon:fishing-bait-fix
Oct 24, 2026
Merged

Adubbz merged 1 commit into
TheMoonPeople:masterfrom
SirFancyBacon:fishing-bait-fix

Conversation

@SirFancyBacon

@SirFancyBacon SirFancyBacon commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Choosing Carrot, Potato Cake, Minon, Battan or Petite Fish as fishing bait used the bait up but left the hook empty. The other eight baits worked. All thirteen now attach. fixes #209

Cause

The bug is in PAL retail's data, not in the port.

  • Each fishing town's event script handles changing bait in program 134 (gedit/e01, e02, e04 and s09). It opens the bait picker (_GOTO_CHANGE_ESA, ext 25), then compares the choice with its own list of eight baits. Only on a match does it load and attach the bait (_LOAD_ITEM_FILE, _LOAD_ITEM, _SET_FISHING_ESA); otherwise it goes straight to fishing with an empty hook.
  • The picker itself (editloop3.cpp) offers all thirteen baits and takes the chosen one from the bag, so the five the list lacks are lost.
  • Those five are items 186 to 190, exactly 20 above the five fruits (166 to 170) the list does carry, so the script was probably written against an older item numbering.

Fix

  • When the bait picker closes (PortEdEventMenuMode, port/src/editloop3.cpp), ListBaitForScript (port/src/fishing.cpp) writes the chosen bait into the first slot of the script's list. The script then attaches it through retail's own path, so nothing else changes.
  • It only acts when the choice is one of the thirteen baits, it isn't on the list already, and the script's eight list variables all hold baits. A cancelled pick, or a script laid out any other way, is left alone; on data whose script already lists every bait it does nothing.
  • The picker's script variable (p_use_item, static in editloop3.cpp) is reached through the unit's stubs header (EditLoop3_p_use_item). Nothing in ps2/src changes.
  • docs/PC.md notes the export under editloop3's per-unit adjustments.

Testing

  • In game (Linux, Flatpak): all five baits attach and catch fish; the other eight behave as before.
  • New tests, FishingBait.*: a bait the list lacks is put on it; a listed bait, a cancelled pick and a differently laid-out script are left alone.
  • Builds with no new warnings; all tests pass but the two GfxValidation ones, which need a Vulkan validation layer the SDK lacks; scripts/port/truncations.py --check passes.
  • Not tested: NTSC data.

PAL retail's bait-changing event (program 134 in gedit/e01, e02, e04 and
s09) only attaches eight of the thirteen baits the picker offers. Carrot,
Potato Cake, Minon, Battan and Petite Fish were taken from the bag and
never attached. When the picker closes on one of them, the port now puts
it on the script's own list, so the script attaches it with retail's code.
@Adubbz
Adubbz merged commit 90db632 into TheMoonPeople:master Oct 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Fishing with bait other than prickly consumes the bait instantly without any fishing

2 participants