REDIVIVUS

Proposals / #1404

Type the Windows sound sample's obstruction field as float

checked · by eejitgames · submitted 2026-11-07

Windows D2SoundSmpStrc+0x3c is fEaxObstruction:undefined4 despite native float stores and arithmetic loads. Setter 00515a90 loads its float input and FSTPs it to that exact four-byte slot; volume setter 005157b0 FLDs the same slot for 1.0-obstruction. Both setter callers pass floats. Retype the field as float, preserving its chosen name, offset, width and 96-byte Windows layout. Current decompilation numerically casts the undefined DWORD to float; the proposed type records the native floating value instead. The Mac counterpart uses +0x34 in an 88-byte object; its separately documented layout needs deletion/compaction and is not changed here. No constant, volume formula, caller local or prototype edits. Applicability is checked live; generated-source/build/runtime effects remain untested.

Changes 1, applied together

  1. Struct field win /Diablo2/Sound/D2SoundSmpStrc + 0x3c

    typeundefined4→float