REDIVIVUS

Proposals / #1086

Type skill, affix, stat cost, level and property record parameters as the TXT record their callers pass

checked · by dtchitt · submitted 2026-11-03

Seven parameters typed int32_t hold a pointer to a TXT record, and every offset the body reads is a field of that record at the width used. ITEMMOD_CanApplyAffix reads version (0xe), itype1 (0x10) and etype1 (0x1e) of D2RareAffixTxt; ITEMMOD_CanApplyAutomod reads mod (0x24), include_type (0x6a) and exclude_type (0x78) of D2MagicAffixTxt. ITEMS_DeserializeSingleStat reads valshift (0x18), saveBits (0x19+i), saveAdd (0x1c+4i) and saveParamBits (0x24+4i) of D2ItemStatCostTxt. OBJECT_PopulateRoomSpecialObjects reads Themes (0x210) of D2LevelsTxt. The two passive mastery helpers compare EType (0x1dc) of D2SkillsTxt with 1 (fire) and 2 (lightning). ITEMMOD_AddStatToItem only null-checks pProperty, but 26 of its 29 call sites pass a D2SetsTxtFStrc * and the rest an int *.

Changes 7, applied together

  1. Retype variable win 0x0065e710 Stack[0x8]

    typeint32_t→D2RareAffixTxt *
  2. Retype variable win 0x0065e620 Stack[0x8]

    typeint32_t→D2MagicAffixTxt *
  3. Retype variable win 0x0062ac80 ESI

    typeint32_t→D2ItemStatCostTxt *
  4. Retype variable win 0x00552560 Stack[0x8]

    typeint32_t→D2LevelsTxt *
  5. Retype variable win 0x004e6ea0 EAX

    typeint32_t→D2SkillsTxt *
  6. Retype variable win 0x004e6f00 EAX

    typeint32_t→D2SkillsTxt *
  7. Retype variable win 0x0065ea50 Stack[0x8]

    typeint32_t→D2SetsTxtFStrc *