REDIVIVUS

Proposals / #1352

Keep the five-entry NPC act level table separate from the NPC index output

checked · by eejitgames · submitted 2026-11-06

win 00576890 stores aActLevels as undefined1[20], but decompile infers int[6] and passes aActLevels+5 to the NPC lookup, absorbing the separate nNpcIndex slot. Native stores at 005768ae/b5/bc/c3/ca initialize five DWORDs at EBP-0x18..-0x8 to 12,20,28,36,45. CMP AL,5 at 005768ac and JNC 005768d1 bound 005768d6's indexed load to those five entries. The unrelated lookup output is EBP-4, whose address is formed at 0057689c and passed at 005768a0. Its callee writes a scalar DWORD index. Persist aActLevels as int[5] and adjacent nNpcIndex as int, matching existing 20+4-byte stack slots. No slot size, name, prototype, shared layout or control-flow change. This corrects inferred frame partitioning; no runtime/byte-match gain claimed.

Changes 2, applied together

  1. Retype variable win 0x00576890 Stack[-0x1c]

    typeundefined1[20]→int[5]
  2. Retype variable win 0x00576890 Stack[-0x8]

    typeundefined4→int