The execute flag of QUEST_SetStateAndBroadcast is a byte tested against 1, not a bool
Ghidra v1900 · 8222e32
The callee compares the stack byte with 1, not with 0: 00544303 CMP byte ptr [EBP+0x10],0x1 / 0054430a JNZ 0x00544322 (return without broadcasting). Typed bool, the flag is printed as a truth test (if (bExecute)), which compiles to a compare with 0; the original's compare with 1 is what a byte flag checked for the value 1 gives. Callers pass byte constants: 00586d9f PUSH 0x1 / 00586dad CALL (Q31_Callback02_NpcDeactivate), 00586fa4 PUSH 0x1 / 00586fb8 CALL (Q31_Callback11_ScrollMessage), 00587c0a PUSH 0x0 / 00587c1e CALL (Q32_Callback11_ScrollMessage), 0058fee4 PUSH 0x0 / 0058fef8 CALL (Q01_Callback11_ScrollMessage); of 155 call sites 111 push 1, 23 push 0, the rest a register. Type only; name kept.
Changes 1, applied together
Set prototype
win 0x00544300signaturevoid QUEST_SetStateAndBroadcast(D2QuestDataStrc * pQuestData, int nPrevStateFlag, D2UnitStrc * pUnit, fpExecuteOnUnitFunction * fpFunction, bool bExecute)→void QUEST_SetStateAndBroadcast(D2QuestDataStrc * pQuestData, int nPrevStateFlag, D2UnitStrc * pUnit, fpExecuteOnUnitFunction * fpFunction, byte bExecute)convention__fastcall