Skip to content

Fix ACT1Q4_SetMonolithOrder skipping a monolith on a collision - #236

Merged
Lectem merged 1 commit into
ThePhrozenKeep:masterfrom
devtejasx:fix/monolith-order-increment-224
Sep 15, 2026
Merged

Lectem merged 1 commit into
ThePhrozenKeep:masterfrom
devtejasx:fix/monolith-order-increment-224

Conversation

@devtejasx

Copy link
Copy Markdown
Contributor

Fixes #224.

ACT1Q4_SetMonolithOrder advances i on every roll. In 1.10 the counter only moves once a stone is placed: the occupied-slot branch at 6FC99F3A jumps to 6FC99F78, past the INC EBP at 6FC99F73, and the loop is bottom-tested against 5. So the original keeps rolling until all five monoliths have a class, while this one rolls exactly five times.

Any collision leaves a slot at 0 and drops a class id. With the rolls 2, 2, 0, 4, 1:

current  [19, 21, 17,  0, 20]
fixed    [18, 20, 17, 21, 19]

The fix moves ++i into the placement branch. One file, +5/-1.

The loop advanced its counter on every roll, but the 1.10 code advances
it only after a stone is placed: the branch taken when the slot is
already occupied (6FC99F3A) jumps to 6FC99F78, past the INC EBP at
6FC99F73, and the loop is bottom-tested against 5. So the original keeps
rolling until all five monoliths have a class, while this one rolls
exactly five times.

With the counter moving on every roll, any collision leaves a slot at
zero and drops a class id. Rolling 2, 2, 0, 4, 1 gives

  current  [19, 21, 17,  0, 20]
  fixed    [18, 20, 17, 21, 19]

- one monolith with no class at all, and 18 never placed.

Closes ThePhrozenKeep#224
@Lectem
Lectem merged commit 5596f5c into ThePhrozenKeep:master Sep 15, 2026
4 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.

ACT1Q4_SetMonolithOrder has incorrect increment condition.

3 participants