REDIVIVUS

Proposals / #688

Type UNITSND_GetGroundMaterialType’s input as floor-tile data

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-01

Ghidra v1797 · 3bccb89

The custom EAX pUnit argument is a D2DrlgTileDataStrc pointer. Its sole caller forwards an unchanged successful tile lookup from either the current room or an adjacent room. Complete lookup obtains the existing typed floor array, walks 48-byte elements by x/y, and returns exactly the element base. The 77-byte target loads input+0x18, matching pTileLibraryEntry, then reads its WORD flags at+6 and returns a material index. Existing tile and tile-library layouts independently match those fields. Full target, caller, lookup and floor-array producer byte ranges were checked against the original Windows PE; CFG confirms both successful producer paths. Retype only existing pUnit@EAX int32_t to D2DrlgTileDataStrc*, preserving its misleading chosen name, custom storage, uint32_t return and __cdecl label. No lookup-return, shared-type or runtime/byte-match claim.

Changes 1, applied together

  1. Retype variable win 0x004cad60 EAX

    typeint32_t→D2DrlgTileDataStrc *