REDIVIVUS

Proposals / #1415

Restore the Mac unit-to-room getter's unit argument and room-pointer result

checked · by eejitgames · submitted 2026-11-07

Mac0018f1ae is stored as undefined UNITS_GetRoom(uint*), although its full100B body reads the unit type and path, then returns the complete room pointer or NULL in EAX. Restore D2RoomStrc* UNITS_GetRoom(D2UnitStrc*) while retaining its chosen names and one-stack-argument cdecl ABI. The90B Windows counterpart00620bb0 already has that typed contract; its RET4 differs from Mac's plainRET and must not be copied. Existing unit/path layouts and both native branch structures independently agree. All733 directCALL encodings and native argument setups were checked:732 within short contexts, one resolved in the complete852B caller.2BnonexecLINKEDIT is not a callback.1414 changes only the separate dynamic-path leaf; this op does not assume it applied. Flag the stale no-Windows-twin comment for review.

Changes 1, applied together

  1. Set prototype mac 0x0018f1ae

    signatureundefined UNITS_GetRoom(uint * pUnit)→D2RoomStrc * UNITS_GetRoom(D2UnitStrc * pUnit)
    convention__cdecl