REDIVIVUS

Proposals / #1100

Type the 13 queued unit-change handlers' packet argument as the D2GSPacketSrv struct for their opcode

checked · by dtchitt · submitted 2026-11-03

The unit-change opcodes (0x0C to 0x10, 0x4C, 0x4D, 0x67 to 0x6D) are queued per unit, and their real handler sits in the third dword of the opcode's 12-byte entry in the client handler table at 007114d0 (entry + 8; the xrefs check all 13). It is called with the unit in ECX and the packet bytes in EDX, which these handlers type as char * pBytes, so the source reads *(uint16_t*)(pBytes + 7). Each opcode already has a D2GSPacketSrv struct, and every offset each body reads lands on a field of that struct at the width used: for 0x0D, nUnitType, dwUnitGUID, nMessageType, wX, wY, nHitClass and nHpPercent; for 0x68, ten reads from nMode to the path fields. The same typing as 797 and the table handlers in 1099; the chosen name pBytes stays.

Changes 13, applied together

  1. Retype variable win 0x0045cc70 EDX

    typechar *→D2GSPacketSrv0x0C *
  2. Retype variable win 0x0045ccc0 EDX

    typechar *→D2GSPacketSrv0x0D *
  3. Retype variable win 0x0045cd10 EDX

    typechar *→D2GSPacketSrv0x0E *
  4. Retype variable win 0x0045cd40 EDX

    typechar *→D2GSPacketSrv0x0F *
  5. Retype variable win 0x0045cd90 EDX

    typechar *→D2GSPacketSrv0x10 *
  6. Retype variable win 0x0045df00 EDX

    typechar *→D2GSPacketSrv0x4C *
  7. Retype variable win 0x0045df60 EDX

    typechar *→D2GSPacketSrv0x4D *
  8. Retype variable win 0x0045cde0 EDX

    typechar *→D2GSPacketSrv0x67 *
  9. Retype variable win 0x0045ce30 EDX

    typechar *→D2GSPacketSrv0x68 *
  10. Retype variable win 0x0045cea0 EDX

    typechar *→D2GSPacketSrv0x69 *
  11. Retype variable win 0x0045cf40 EDX

    typechar *→D2GSPacketSrv0x6B *
  12. Retype variable win 0x0045cfb0 EDX

    typechar *→D2GSPacketSrv0x6C *
  13. Retype variable win 0x0045d010 EDX

    typechar *→D2GSPacketSrv0x6D *