Skip to content

contract: 16-bit CharFlag; me.maxdiff and me.ladder from the character flags - #69

Merged
ResurrectedTrader merged 1 commit into
mainfrom
charflag-16bit
Oct 7, 2026
Merged

ResurrectedTrader merged 1 commit into
mainfrom
charflag-16bit

Conversation

@ResurrectedTrader

Copy link
Copy Markdown
Owner

Summary

The character flags are one 16-bit word (1.14d stores and tests BnetData+0x1EF as a word):

  • CharFlag is uint16_t; BnetData carries one CharFlag at 0x1EF instead of splitting it into nCharFlags / nMaxDiff, so GetCharFlags() returns the whole word.
  • GetMaxDiff / IsLadder leave the contract; the bindings derive them from the flags. me.maxdiff is the progression (flags & ProgressionMask) >> 8 (documented with how to turn it into a difficulty); me.ladder is a boolean, the Ladder bit (0x40) - the BnetData+0x3C0 byte read before is never written by the game. kolbot / SoloPlay only test it for truthiness / > 0. The character-state identity.ladder reads the same bit.
  • The congrats-screen intercept sets only the progression bits, so WeaponSwitch survives; GetGameType reads the flags' expansion bit.

Script-visible: me.ladder is a boolean from the Ladder bit; me.maxdiff no longer carries the WeaponSwitch bit.

Stack

Stacked on #68 (this PR's base branch); it depends on that change and the ones below it. Merge in order; once the base merges, this PR is retargeted to main (automatically when the merged branch is deleted).

Verification

  • build.ps1 Release (Win32, the 1.14d DLL): builds
  • build.ps1 test: 169/169 pass
  • build.ps1 check-format: clean
  • scripts/gen_enum_names.py --check: up to date

🤖 Generated with Claude Code

@ResurrectedTrader
ResurrectedTrader added this pull request to stack #78 October 6, 2026 23:12
@ResurrectedTrader
ResurrectedTrader force-pushed the charflag-16bit branch 2 times, most recently from 675b986 to 6fbb2bc Compare October 7, 2026 07:03
@ResurrectedTrader
ResurrectedTrader force-pushed the charflag-16bit branch 4 times, most recently from 128ed0b to d9f5170 Compare October 7, 2026 07:30
Base automatically changed from characterstate-raw-game-data to main October 7, 2026 07:35
…r flags

The game keeps the character flags as one 16-bit word: 1.14d stores
BnetData+0x1EF with a word move and tests it as one. CharFlag is now
uint16_t, and BnetData carries one CharFlag at 0x1EF where it split the
word into nCharFlags and nMaxDiff, so GetCharFlags returns the whole
word (ProgressionMask and WeaponSwitch read 0 before).

GetMaxDiff and IsLadder leave the contract; the bindings derive them:
- me.maxdiff is the progression, (flags & ProgressionMask) >> 8 - the
  acts completed across all difficulties, documented with how to turn it
  into a difficulty. 1.14d returned the same high byte (plus the
  WeaponSwitch bit).
- me.ladder is a boolean, the Ladder bit (0x40), which 1.14d sets on
  realm characters and the creation screen's ladder toggle flips; the
  BnetData+0x3C0 byte read before is never touched by the game's own
  code. kolbot / SoloPlay only test it for truthiness or > 0; the
  character-state identity.ladder reads the same bit.

The 1.14d congrats-screen intercept sets the progression bits to 10
instead of overwriting the whole high byte, so WeaponSwitch survives,
and lod114d's GetGameType reads the flags' expansion bit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ResurrectedTrader
ResurrectedTrader merged commit ee771a5 into main Oct 7, 2026
1 check passed
@ResurrectedTrader
ResurrectedTrader deleted the charflag-16bit branch October 7, 2026 07:42
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