REDIVIVUS

Proposals / #1351

Use BOOL for the NPC item updater's integer stackability result

applied · by eejitgames · submitted 2026-11-06, applied 2026-11-06

Ghidra vwin 1971 · 9dc1ead

win 005761c0 explicitly types the EAX local fIsStackable as float, so decompile emits (float)IsStackable(pItem) and comparison with 0.0. Native 005761e8 CALL 006289f0 is followed immediately by 005761ed TEST EAX,EAX / 005761ef JZ: an integer predicate, with no float conversion or comparison. The callee already declares BOOL and defines full EAX on every returning path: 00628a2b MOVZX EAX,byte ptr [EAX+0x132] / RET 4, or 00628a36 XOR EAX,EAX / RET 4. The byte is existing D2ItemsTxt.bStackable. Retype only this local float->BOOL (both 4 bytes), matching the verified callee contract and native test. Preserve the chosen name, EAX storage, all prototypes and shared layouts. This corrects the unsupported floating-point representation; no gameplay, compile or byte-match improvement is claimed.

Changes 1, applied together

  1. Retype variable win 0x005761c0 EAX

    typefloat→BOOL