Skip to content

Fix special cargo selection - #4

Open
arclabs561 wants to merge 1 commit into
wraitii:mainfrom
arclabs561:trade-cargo-priority
Open

arclabs561 wants to merge 1 commit into
wraitii:mainfrom
arclabs561:trade-cargo-priority

Conversation

@arclabs561

Copy link
Copy Markdown

When several special goods qualify at a port, Nova picks the highest eligible cargo ID for each trade row. At Latin, that means the port buys Bio-Engineered Kelp for 125 credits per ton. I checked the sale in game and added a regression test for both rows.

The Windows Trade Center scans cargo IDs in ascending order. A match
updates the row and advances to the next cargo (0x48cd32 and 0x48cda7).
Each row therefore keeps the last eligible ID. The port stopped at the
first match.

At Latin, Guinness Barrels (129) and Bio-Engineered Kelp (148) both
qualify. Running the original CE r4 scan under QEMU gave kelp at 125
credits per ton. Replaying a one-ton sale in the patched port removed
the kelp, left the Guinness aboard, and credited 125.

Exercise both rows with three overlapping goods. The highest ID fails
SellOn but passes BuyOn, so the two rows must pick different IDs.
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.

1 participant