Recover Mac teleport coordinates and its full Boolean status
Ghidra vmac 105 · 3bccb89
Complete807-byte SUNIT_TeleportUnit uses nX/nY by value: signed comparisons against room X/Y bounds, copying them into a POINT, then passing those numeric coordinates onward. They are not NPC-record pointers. Its only RET follows MOV EAX,EDI; complete CFG proves EDI can reach it only from five zero definitions or MOV EDI,1, so return is full32-bit BOOL. All20 direct call setups across19 complete caller bodies were inspected; callers supply coordinate values and consume or ignore the status. Two six-way PIC jump tables in the AI callers are independently decoded. Restore int32_t coordinates and BOOL return together, preserving all seven parameter positions/names, cdecl, bare RET and remaining types. Full original Mac database bytes audited, including16876 caller bytes. No Windows twin, shared layout, source/runtime or matching gain inferred; LINKEDIT DATA ref is nonexecutable. Coordinate inputs are EBP+0x14/+0x18; full EAX status is set at0027873e.
Changes 1, applied together
Set prototype
mac 0x00278421signatureundefined SUNIT_TeleportUnit(D2GameStrc * pGame, D2UnitStrc * pUnit, D2RoomStrc * param_3, D2UnitDataPlayerInteractedNPCStrc * nX, D2UnitDataPlayerInteractedNPCStrc * nY, int bExactPosition, int param_7)→BOOL SUNIT_TeleportUnit(D2GameStrc * pGame, D2UnitStrc * pUnit, D2RoomStrc * param_3, int32_t nX, int32_t nY, int bExactPosition, int param_7)convention__cdecl