Skip to content

Issue #10 Horses and muskets that don't exist can't be assigned to co… - #14

Merged
dderevjanik merged 1 commit into
OpenCol:mainfrom
rossdrew:fix/profession-stock-delta-i16
Oct 31, 2026
Merged

dderevjanik merged 1 commit into
OpenCol:mainfrom
rossdrew:fix/profession-stock-delta-i16

Conversation

@rossdrew

Copy link
Copy Markdown
Contributor

Using int here means that colony stock takes up more memory, so when it is cleared with an 0x20 sized memset, it's not large enough and garbage is left behind in the colony stock allowing stock beyond the 8th item to be used when it doesn't exist.

Fixes #10

…d to colonists

Using int here means that colony stock takes up more memory, so when it is cleared with
an 0x20 sized memset, it's not large enough and garbage is left behind in the colony
stock allowing it to be used.

Fixes OpenCol#10
@rossdrew rossdrew mentioned this pull request Oct 29, 2026
@dderevjanik

Copy link
Copy Markdown
Contributor

Thanks, @rossdrew, good catch! The memset(l.stock_delta, 0, 0x20) only cleared half of an int[16], and i16 matches the original's frame layout (BP-106..BP-e6 is 0x20 bytes).

I ran the quick gate locally: it builds, the import check and the header checks pass, AUTO01 is 121 of 121 checkpoints in lockstep, and the map, colony and about sessions pass. Merging.

@dderevjanik
dderevjanik merged commit 0fa0011 into OpenCol:main Oct 31, 2026
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.

Unlimited Horses

2 participants