REDIVIVUS

Proposals / #1696

Restore the Mac shield predicate's BOOL result and DWORD lookup local

checked · by eejitgames · submitted 2026-11-08

Mac HasShield at 00191a17 has an undefined4 result and a one-byte stored local_c passed as int* to 00142bfd. Every normal result path sets full EAX to 0 or 1, and its sole caller tests all 32 bits. Windows 006225f0 already returns BOOL and matches the class cases, component lookup and item-type comparison. Native LEA [EBP-8] passes the local to a lookup that writes a DWORD on both success and failure. Restore BOOL and a four-byte int nItemClassId at Stack[-0xc]; preserve the unit input, chosen function name and Mac cdecl.

Changes 3, applied together

  1. Set prototype mac 0x00191a17

    signatureundefined4 HasShield(D2UnitStrc * pUnit)→BOOL HasShield(D2UnitStrc * pUnit)
    convention__cdecl
  2. Retype variable mac 0x00191a17 Stack[-0xc]

    typeundefined→int
  3. Rename variable mac 0x00191a17 Stack[-0xc]

    namelocal_c→nItemClassId