REDIVIVUS

Proposals / #1083

Type the party screen actions' error out-parameter, and PARTYSCREEN_LeaveParty's target

checked · by dtchitt · submitted 2026-11-03

Resubmit of 1024 against the current names, as its stale note invited. The five action table entries still type the last parameter as an integer, though PlayerScreen_DispatchAction passes the address of its int local nError (LEA ECX,[EBP-4] at 005a6051, PUSH ECX at 005a6054, CALL EAX at 005a605c, CMP dword ptr [EBP-4],0 at 005a605e). PARTYSCREEN_ToggleHostile writes through it as a dword (005a5fde MOV ECX,[EBP+0x10]; 005a5fe1 MOV dword ptr [ECX],1). LeaveParty's pTarget and dwArg take the same types its siblings already have. It should remove the (uint32_t)&bWantHostile cast at the 005a5f96 call. The funcdef pfnPartyScreenAction still has uint dwArg2 for this slot; a proposal can't change a funcdef, so it needs int * by hand. What would disprove this: a table entry that reads the slot as a value. None of the five does.

Changes 7, applied together

  1. Retype variable win 0x005a57b0 Stack[0xc]

    typeundefined4→int *
  2. Retype variable win 0x005a5840 Stack[0xc]

    typeundefined4→int *
  3. Retype variable win 0x005a58a0 Stack[0xc]

    typeundefined4→int *
  4. Retype variable win 0x005a5d20 Stack[0x4]

    typeundefined4→D2UnitStrc *
  5. Retype variable win 0x005a5d20 Stack[0x8]

    typeundefined4→uint32_t
  6. Retype variable win 0x005a5d20 Stack[0xc]

    typeundefined4→int *
  7. Retype variable win 0x005a5e50 Stack[0xc]

    typeundefined4 *→int *