diff --git a/Source/msg.cpp b/Source/msg.cpp index da4c64f8..ea3ea826 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -347,19 +347,24 @@ void __fastcall delta_monster_hp(int mi, int hp, BYTE bLevel) } // 679660: using guessed type char gbMaxPlayers; -void __fastcall delta_sync_monster(TCmdLocParam1 *packet, BYTE level) +void __fastcall delta_sync_monster(const TSyncMonster *pSync, BYTE bLevel) { DMonsterStr *pD; - if (gbMaxPlayers != 1) { - sgbDeltaChanged = TRUE; - pD = &sgLevels[level].monster[(BYTE)packet->bCmd]; - if (pD->_mhitpoints) { - pD->_mx = packet->x; - pD->_my = packet->y; - pD->_mactive = -1; - pD->_menemy = packet->wParam1; - } + if(gbMaxPlayers == 1) { + return; + } + + /// ASSERT: assert(pSync != NULL); + /// ASSERT: assert(bLevel < NUMLEVELS); + sgbDeltaChanged = TRUE; + + pD = &sgLevels[bLevel].monster[pSync->_mndx]; + if(pD->_mhitpoints != 0) { + pD->_mx = pSync->_mx; + pD->_my = pSync->_my; + pD->_mactive = -1; + pD->_menemy = pSync->_menemy; } } // 679660: using guessed type char gbMaxPlayers; @@ -1304,7 +1309,7 @@ void __fastcall DeltaImportJunk(BYTE *src) int __fastcall On_SYNCDATA(void *packet, int pnum) { - return sync_update(pnum, (TSyncHeader *)packet); + return sync_update(pnum, (const BYTE *)packet); } int __fastcall On_WALKXY(TCmdLoc *pCmd, int pnum) diff --git a/Source/msg.h b/Source/msg.h index a8cd4a05..07c17f8f 100644 --- a/Source/msg.h +++ b/Source/msg.h @@ -23,7 +23,7 @@ int __fastcall msg_comp_level(BYTE *buffer, BYTE *end); void __cdecl delta_init(); void __fastcall delta_kill_monster(int mi, BYTE x, BYTE y, BYTE bLevel); void __fastcall delta_monster_hp(int mi, int hp, BYTE bLevel); -void __fastcall delta_sync_monster(TCmdLocParam1 *packet, BYTE level); +void __fastcall delta_sync_monster(const TSyncMonster *pSync, BYTE bLevel); void __fastcall delta_sync_golem(TCmdGolem *pG, int pnum, BYTE bLevel); void __fastcall delta_leave_sync(BYTE bLevel); BOOL __fastcall delta_portal_inited(int i); diff --git a/Source/multi.cpp b/Source/multi.cpp index 5bd525d3..6ba4125e 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -96,7 +96,7 @@ void __fastcall NetRecvPlrData(TPkt *pkt) void __fastcall NetSendHiPri(BYTE *pbMsg, BYTE bLen) { unsigned char *v5; // eax - TSyncHeader *v6; // eax + BYTE *v6; // eax int v7; // eax int v8; // eax TPkt pkt; // [esp+Ch] [ebp-204h] @@ -111,7 +111,7 @@ void __fastcall NetSendHiPri(BYTE *pbMsg, BYTE bLen) NetRecvPlrData(&pkt); size = gdwNormalMsgSize - 19; v5 = multi_recv_packet(&sgHiPriBuf, pkt.body, &size); - v6 = (TSyncHeader *)multi_recv_packet(&sgLoPriBuf, v5, &size); + v6 = multi_recv_packet(&sgLoPriBuf, v5, &size); v7 = sync_all_monsters(v6, size); v8 = gdwNormalMsgSize - v7; pkt.hdr.wLen = v8; diff --git a/Source/sync.cpp b/Source/sync.cpp index 331d3fcd..2f462bf2 100644 --- a/Source/sync.cpp +++ b/Source/sync.cpp @@ -3,342 +3,286 @@ #include "../types.h" WORD sync_word_6AA708[MAXMONSTERS]; -int sgnMonsters; // weak +int sgnMonsters; WORD sgwLRU[MAXMONSTERS]; int sgnSyncItem; -int sgnSyncPInv; // weak +int sgnSyncPInv; -int __fastcall sync_all_monsters(TSyncHeader *packet, int size) +DWORD __fastcall sync_all_monsters(const BYTE *pbBuf, DWORD dwMaxLen) { - int result; // eax - TSyncHeader *v3; // esi - int v4; // ebx - TSyncMonster *v5; // edi - unsigned int v6; // [esp+4h] [ebp-4h] + TSyncHeader *pHdr; + int i; + BOOL sync; - result = size; - if (nummonsters >= 1 && (unsigned int)size >= 0x2B) { - v3 = packet; - v6 = size - 38; - v4 = 0; - packet->bCmd = CMD_SYNCDATA; - v5 = (TSyncMonster *)(&packet->bPInvId + 1); - packet->bLevel = currlevel; - packet->wLen = 0; - SyncPlrInv(packet); - sync_one_monster(); - if (nummonsters > 0) { - do { - if (v6 < 5 || (v4 >= 2 || !sync_monster_active2(v5)) && !sync_monster_active(v5)) - break; - v3->wLen += 5; - v6 -= 5; - ++v5; - ++v4; - } while (v4 < nummonsters); - } - result = v6; + if(nummonsters < 1) { + return dwMaxLen; } - return result; + if(dwMaxLen < sizeof(*pHdr) + sizeof(TSyncMonster)) { + return dwMaxLen; + } + + pHdr = (TSyncHeader *)pbBuf; + pbBuf += sizeof(*pHdr); + dwMaxLen -= sizeof(*pHdr); + + pHdr->bCmd = CMD_SYNCDATA; + pHdr->bLevel = currlevel; + pHdr->wLen = 0; + SyncPlrInv(pHdr); + /// ASSERT: assert(dwMaxLen <= 0xffff); + sync_one_monster(); + + for(i = 0; i < nummonsters && dwMaxLen >= sizeof(TSyncMonster); i++) { + sync = FALSE; + if(i < 2) { + sync = sync_monster_active2((TSyncMonster *)pbBuf); + } + if(!sync) { + sync = sync_monster_active((TSyncMonster *)pbBuf); + } + if(!sync) { + break; + } + pbBuf += sizeof(TSyncMonster); + pHdr->wLen += sizeof(TSyncMonster); + dwMaxLen -= sizeof(TSyncMonster); + } + + return dwMaxLen; } void __cdecl sync_one_monster() { - int i; // ebx - int v1; // edi - int v2; // esi - WORD v3; // bp - WORD v4; // ax - BOOLEAN v5; // zf - WORD *v6; // edx - WORD *v7; // eax + int i, m; - for (i = 0; i < nummonsters; ++i) { - v1 = monstactive[i]; - v2 = monstactive[i]; - v3 = abs(plr[myplr].WorldY - monster[v2]._my); - v4 = abs(plr[myplr].WorldX - monster[v2]._mx); - v5 = monster[v2]._msquelch == 0; - v6 = &sync_word_6AA708[v1]; - *v6 = v4 + v3; - if (v5) { - *v6 = v4 + v3 + 4096; - } else { - v7 = &sgwLRU[v1]; - if (*v7) - --*v7; + for(i = 0; i < nummonsters; i++) { + m = monstactive[i]; + sync_word_6AA708[m] = abs(plr[myplr].WorldX - monster[m]._mx) + abs(plr[myplr].WorldY - monster[m]._my); + if(monster[m]._msquelch == 0) { + sync_word_6AA708[m] += 0x1000; + } else if(sgwLRU[m] != 0) { + sgwLRU[m]--; } } } -int __fastcall sync_monster_active(TSyncMonster *packet) +BOOL __fastcall sync_monster_active(TSyncMonster *p) { - unsigned int v1; // ebx - int v2; // esi - int v3; // edx - int v4; // eax + int i, m, ndx; + DWORD lru; - v1 = -1; - v2 = 0; - v3 = -1; - if (nummonsters <= 0) - return 0; - do { - v4 = monstactive[v2]; - if (sync_word_6AA708[v4] < v1 && sgwLRU[v4] < 0xFFFEu) { - v1 = sync_word_6AA708[v4]; - v3 = monstactive[v2]; + ndx = -1; + lru = 0xFFFFFFFF; + + for(i = 0; i < nummonsters; i++) { + m = monstactive[i]; + if(sync_word_6AA708[m] < lru && sgwLRU[m] < 0xFFFE) { + lru = sync_word_6AA708[m]; + ndx = monstactive[i]; } - ++v2; - } while (v2 < nummonsters); - if (v3 == -1) - return 0; - sync_monster_pos(packet, v3); - return 1; + } + + if(ndx == -1) { + return FALSE; + } + + sync_monster_pos(p, ndx); + return TRUE; } -void __fastcall sync_monster_pos(TSyncMonster *packet, int mon_id) +void __fastcall sync_monster_pos(TSyncMonster *p, int ndx) { - int v2; // ebx - TSyncMonster *v3; // esi - int v4; // edi - int v5; // eax - WORD v6; // cx - char v7; // cl + p->_mndx = ndx; + p->_mx = monster[ndx]._mx; + p->_my = monster[ndx]._my; + p->_menemy = encode_enemy(ndx); + p->_mdelta = sync_word_6AA708[ndx] > 255 ? 255 : sync_word_6AA708[ndx]; - v2 = mon_id; - v3 = packet; - v4 = mon_id; - packet->_mndx = mon_id; - packet->_mx = monster[mon_id]._mx; - packet->_my = monster[mon_id]._my; - packet->_menemy = encode_enemy(mon_id); - v5 = v2; - v6 = sync_word_6AA708[v2]; - if (v6 > 0xFFu) - _LOBYTE(v6) = -1; - v3->_mdelta = v6; - v7 = monster[v4]._msquelch; - sync_word_6AA708[v5] = -1; - sgwLRU[v5] = -(v7 != 0) - 1; + sync_word_6AA708[ndx] = 0xFFFF; + sgwLRU[ndx] = monster[ndx]._msquelch == 0 ? 0xFFFF : 0xFFFE; } -int __fastcall sync_monster_active2(TSyncMonster *packet) +BOOL __fastcall sync_monster_active2(TSyncMonster *p) { - int v1; // edx - unsigned int v2; // ebp - int v3; // eax - int v4; // esi - int v6; // [esp+8h] [ebp-4h] + int i, m, ndx; + DWORD lru; - v1 = -1; - v2 = 65534; - if (nummonsters <= 0) - return 0; - v3 = sgnMonsters; - v6 = nummonsters; - do { - if (v3 >= nummonsters) - v3 = 0; - v4 = monstactive[v3]; - if (sgwLRU[v4] < v2) { - v2 = sgwLRU[v4]; - v1 = monstactive[v3]; + ndx = -1; + lru = 0xFFFE; + + for(i = 0; i < nummonsters; i++) { + if(sgnMonsters >= nummonsters) { + sgnMonsters = 0; } - ++v3; - --v6; - } while (v6); - sgnMonsters = v3; - if (v1 == -1) - return 0; - sync_monster_pos(packet, v1); - return 1; + m = monstactive[sgnMonsters]; + if(sgwLRU[m] < lru) { + lru = sgwLRU[m]; + ndx = monstactive[sgnMonsters]; + } + sgnMonsters++; + } + + if(ndx == -1) { + return FALSE; + } + + sync_monster_pos(p, ndx); + return TRUE; } -// 6AA898: using guessed type int sgnMonsters; -void __fastcall SyncPlrInv(TSyncHeader *pSync) +void __fastcall SyncPlrInv(TSyncHeader *pHdr) { - int v1; // edx - int v2; // eax - int v3; // eax - short v4; // dx - short v5; // bx - ItemStruct *pItem; // eax + int ii; + ItemStruct *pItem; - if (numitems <= 0) { - pSync->bItemI = -1; + if(numitems > 0) { + if(sgnSyncItem >= numitems) { + sgnSyncItem = 0; + } + ii = itemactive[sgnSyncItem++]; + pHdr->bItemI = ii; + pHdr->bItemX = item[ii]._ix; + pHdr->bItemY = item[ii]._iy; + pHdr->wItemIndx = item[ii].IDidx; + if(item[ii].IDidx == IDI_EAR) { + pHdr->wItemCI = (item[ii]._iName[7] << 8) | item[ii]._iName[8]; + pHdr->dwItemSeed = (item[ii]._iName[9] << 24) | (item[ii]._iName[10] << 16) | (item[ii]._iName[11] << 8) | item[ii]._iName[12]; + pHdr->bItemId = item[ii]._iName[13]; + pHdr->bItemDur = item[ii]._iName[14]; + pHdr->bItemMDur = item[ii]._iName[15]; + pHdr->bItemCh = item[ii]._iName[16]; + pHdr->bItemMCh = item[ii]._iName[17]; + pHdr->wItemVal = (item[ii]._iName[18] << 8) | ((item[ii]._iCurs - 19) << 6) | item[ii]._ivalue; + pHdr->dwItemBuff = (item[ii]._iName[19] << 24) | (item[ii]._iName[20] << 16) | (item[ii]._iName[21] << 8) | item[ii]._iName[22]; + } else { + pHdr->wItemCI = item[ii]._iCreateInfo; + pHdr->dwItemSeed = item[ii]._iSeed; + pHdr->bItemId = item[ii]._iIdentified; + pHdr->bItemDur = item[ii]._iDurability; + pHdr->bItemMDur = item[ii]._iMaxDur; + pHdr->bItemCh = item[ii]._iCharges; + pHdr->bItemMCh = item[ii]._iMaxCharges; + if(item[ii].IDidx == IDI_GOLD) { + pHdr->wItemVal = item[ii]._ivalue; + } + } } else { - v1 = sgnSyncItem; - if (sgnSyncItem >= numitems) - v1 = 0; - v2 = itemactive[v1]; - sgnSyncItem = v1 + 1; - pSync->bItemI = v2; - v3 = v2; - pSync->bItemX = item[v3]._ix; - pSync->bItemY = item[v3]._iy; - pSync->wItemIndx = item[v3].IDidx; - if (item[v3].IDidx == IDI_EAR) { - _LOBYTE(v4) = 0; - _HIBYTE(v4) = item[v3]._iName[7]; - _LOBYTE(v5) = 0; - pSync->wItemCI = item[v3]._iName[8] | v4; - pSync->dwItemSeed = item[v3]._iName[12] | ((item[v3]._iName[11] | ((item[v3]._iName[10] | (item[v3]._iName[9] << 8)) << 8)) << 8); - pSync->bItemId = item[v3]._iName[13]; - pSync->bItemDur = item[v3]._iName[14]; - pSync->bItemMDur = item[v3]._iName[15]; - pSync->bItemCh = item[v3]._iName[16]; - pSync->bItemMCh = item[v3]._iName[17]; - _HIBYTE(v5) = item[v3]._iName[18]; - pSync->wItemVal = LOWORD(item[v3]._ivalue) | v5 | ((LOWORD(item[v3]._iCurs) - 19) << 6); - pSync->dwItemBuff = item[v3]._iName[22] | ((item[v3]._iName[21] | ((item[v3]._iName[20] | (item[v3]._iName[19] << 8)) << 8)) << 8); - } else { - pSync->wItemCI = item[v3]._iCreateInfo; - pSync->dwItemSeed = item[v3]._iSeed; - pSync->bItemId = item[v3]._iIdentified; - pSync->bItemDur = item[v3]._iDurability; - pSync->bItemMDur = item[v3]._iMaxDur; - pSync->bItemCh = item[v3]._iCharges; - pSync->bItemMCh = item[v3]._iMaxCharges; - if (!item[v3].IDidx) - pSync->wItemVal = item[v3]._ivalue; - } + pHdr->bItemI = -1; } + + /// ASSERT: assert((DWORD) sgnSyncPInv < NUM_INVLOC); pItem = &plr[myplr].InvBody[sgnSyncPInv]; - if (pItem->_itype == -1) { - pSync->bPInvLoc = -1; + if(pItem->_itype != -1) { + pHdr->bPInvLoc = sgnSyncPInv; + pHdr->wPInvIndx = pItem->IDidx; + pHdr->wPInvCI = pItem->_iCreateInfo; + pHdr->dwPInvSeed = pItem->_iSeed; + pHdr->bPInvId = pItem->_iIdentified; } else { - pSync->bPInvLoc = sgnSyncPInv; - pSync->wPInvIndx = pItem->IDidx; - pSync->wPInvCI = pItem->_iCreateInfo; - pSync->dwPInvSeed = pItem->_iSeed; - pSync->bPInvId = pItem->_iIdentified; + pHdr->bPInvLoc = -1; } - if (++sgnSyncPInv >= 7) + + sgnSyncPInv++; + if(sgnSyncPInv >= NUM_INVLOC) { sgnSyncPInv = 0; -} -// 6AAA34: using guessed type int sgnSyncPInv; - -int __fastcall sync_update(int pnum, TSyncHeader *packet) -{ - TSyncHeader *v2; // esi - TSyncMonster *v3; // edi - int v4; // ebp - unsigned short v5; // ax - unsigned int v6; // ebx - - v2 = packet; - v3 = (TSyncMonster *)(&packet->bPInvId + 1); - v4 = pnum; - if (packet->bCmd != CMD_SYNCDATA) - app_fatal("bad sync command"); - if (gbBufferMsgs != 1 && v4 != myplr) { - v5 = v2->wLen; - if (v5 >= 5u) { - v6 = v5 / 5u; - do { - if (currlevel == v2->bLevel) - sync_monster(v4, v3); - delta_sync_monster((TCmdLocParam1 *)v3, v2->bLevel); - ++v3; - --v6; - } while (v6); - } } - return v2->wLen + 38; +} + +DWORD __fastcall sync_update(int pnum, const BYTE *pbBuf) +{ + TSyncHeader *pHdr; + WORD wLen; + + pHdr = (TSyncHeader *)pbBuf; + pbBuf += sizeof(*pHdr); + + if(pHdr->bCmd != CMD_SYNCDATA) { + app_fatal("bad sync command"); + } + + /// ASSERT: assert(gbBufferMsgs != BUFFER_PROCESS); + + if(gbBufferMsgs == 1) { + return pHdr->wLen + sizeof(*pHdr); + } + if(pnum == myplr) { + return pHdr->wLen + sizeof(*pHdr); + } + + for(wLen = pHdr->wLen; wLen >= sizeof(TSyncMonster); wLen -= sizeof(TSyncMonster)) { + if(currlevel == pHdr->bLevel) { + sync_monster(pnum, (TSyncMonster *)pbBuf); + } + delta_sync_monster((TSyncMonster *)pbBuf, pHdr->bLevel); + pbBuf += sizeof(TSyncMonster); + } + + /// ASSERT: assert(wLen == 0); + + return pHdr->wLen + sizeof(*pHdr); } // 676194: using guessed type char gbBufferMsgs; -void __fastcall sync_monster(int pnum, TSyncMonster *packet) +void __fastcall sync_monster(int pnum, const TSyncMonster *p) { - TSyncMonster *v2; // edi - int v3; // ecx - int v4; // ebx - int v5; // esi - int v6; // ST18_4 - unsigned int v7; // ecx - unsigned int v8; // eax - int v9; // eax - int v10; // ecx - signed int v11; // ST14_4 - int v12; // eax - int v13; // eax - int v14; // eax - //int v15; // eax - int v16; // eax - int md; // [esp+Ch] [ebp-8h] - int mda; // [esp+Ch] [ebp-8h] + int i, ndx, md, mdx, mdy; + DWORD delta; - v2 = packet; - md = pnum; - v3 = 0; - v4 = (unsigned char)packet->_mndx; - v5 = v4; - if (monster[v5]._mhitpoints) { - if (nummonsters > 0) { - do { - if (monstactive[v3] == v4) - break; - ++v3; - } while (v3 < nummonsters); - } - v6 = abs(plr[myplr].WorldY - monster[v5]._my); - v7 = abs(plr[myplr].WorldX - monster[v5]._mx) + v6; - if (v7 > 0xFF) - v7 = 255; - v8 = (unsigned char)v2->_mdelta; - if (v7 >= v8 && (v7 != v8 || md <= myplr)) { - v9 = (unsigned char)v2->_mx; - if (monster[v5]._mfutx != v9 || monster[v5]._mfuty != (unsigned char)v2->_my) { - v10 = monster[v5]._mmode; - if (v10 != MM_CHARGE && v10 != MM_STONE) { - v11 = abs(monster[v5]._mx - v9); - v12 = abs(monster[v5]._my - (unsigned char)v2->_my); - if (v11 > 2 || v12 > 2) { - if (dMonster[(unsigned char)v2->_mx][(unsigned char)v2->_my]) { - LABEL_23: - decode_enemy(v4, (unsigned char)v2->_menemy); - return; - } - M_ClearSquares(v4); - dMonster[(unsigned char)v2->_mx][(unsigned char)v2->_my] = v4 + 1; - monster[v5]._mx = (unsigned char)v2->_mx; - monster[v5]._my = (unsigned char)v2->_my; - decode_enemy(v4, (unsigned char)v2->_menemy); - v16 = GetDirection( - (unsigned char)v2->_mx, - (unsigned char)v2->_my, - (unsigned char)monster[v5]._menemyx, - (unsigned char)monster[v5]._menemyy); - M_StartStand(v4, v16); - } else { - v13 = monster[v5]._mmode; - if (v13 >= MM_WALK && v13 <= MM_WALK3) - goto LABEL_23; - v14 = GetDirection( - monster[v5]._mx, - monster[v5]._my, - (unsigned char)v2->_mx, - (unsigned char)v2->_my); - mda = v14; - //_LOBYTE(v15) = DirOK(v4, v14); - if (!DirOK(v4, v14)) - goto LABEL_23; - M_ClearSquares(v4); - dMonster[monster[v5]._mx][monster[v5]._my] = v4 + 1; - M_WalkDir(v4, mda); - } - monster[v5]._msquelch = -1; - goto LABEL_23; - } - } + ndx = p->_mndx; + + if(monster[ndx]._mhitpoints == 0) { + return; + } + + for(i = 0; i < nummonsters; i++) { + if(monstactive[i] == ndx) { + break; } } + + delta = abs(plr[myplr].WorldX - monster[ndx]._mx) + abs(plr[myplr].WorldY - monster[ndx]._my); + if(delta > 255) { + delta = 255; + } + + if(delta < p->_mdelta || (delta == p->_mdelta && pnum > myplr)) { + return; + } + if(monster[ndx]._mfutx == p->_mx && monster[ndx]._mfuty == p->_my) { + return; + } + if(monster[ndx]._mmode == MM_CHARGE || monster[ndx]._mmode == MM_STONE) { + return; + } + + mdx = abs(monster[ndx]._mx - p->_mx); + mdy = abs(monster[ndx]._my - p->_my); + if(mdx <= 2 && mdy <= 2) { + if(monster[ndx]._mmode < MM_WALK || monster[ndx]._mmode > MM_WALK3) { + md = GetDirection(monster[ndx]._mx, monster[ndx]._my, p->_mx, p->_my); + if(DirOK(ndx, md)) { + M_ClearSquares(ndx); + dMonster[monster[ndx]._mx][monster[ndx]._my] = ndx + 1; + M_WalkDir(ndx, md); + monster[ndx]._msquelch = -1; + } + } + } else if(dMonster[p->_mx][p->_my] == 0) { + M_ClearSquares(ndx); + dMonster[p->_mx][p->_my] = ndx + 1; + monster[ndx]._mx = p->_mx; + monster[ndx]._my = p->_my; + decode_enemy(ndx, p->_menemy); + md = GetDirection(p->_mx, p->_my, monster[ndx]._menemyx, monster[ndx]._menemyy); + M_StartStand(ndx, md); + monster[ndx]._msquelch = -1; + } + + decode_enemy(ndx, p->_menemy); } void __cdecl sync_init() { sgnMonsters = 16 * myplr; - memset(sgwLRU, 255, 0x190u); + memset(sgwLRU, 255, sizeof(sgwLRU)); } -// 6AA898: using guessed type int sgnMonsters; diff --git a/Source/sync.h b/Source/sync.h index 56b80bc7..3c327af2 100644 --- a/Source/sync.h +++ b/Source/sync.h @@ -3,18 +3,18 @@ #define __SYNC_H__ extern WORD sync_word_6AA708[MAXMONSTERS]; -extern int sgnMonsters; // weak +extern int sgnMonsters; extern WORD sgwLRU[MAXMONSTERS]; extern int sgnSyncItem; -int __fastcall sync_all_monsters(TSyncHeader *packet, int size); +DWORD __fastcall sync_all_monsters(const BYTE *pbBuf, DWORD dwMaxLen); void __cdecl sync_one_monster(); -int __fastcall sync_monster_active(TSyncMonster *packet); -void __fastcall sync_monster_pos(TSyncMonster *packet, int mon_id); -int __fastcall sync_monster_active2(TSyncMonster *packet); -void __fastcall SyncPlrInv(TSyncHeader *pSync); -int __fastcall sync_update(int pnum, TSyncHeader *packet); -void __fastcall sync_monster(int pnum, TSyncMonster *packet); +BOOL __fastcall sync_monster_active(TSyncMonster *p); +void __fastcall sync_monster_pos(TSyncMonster *p, int ndx); +BOOL __fastcall sync_monster_active2(TSyncMonster *p); +void __fastcall SyncPlrInv(TSyncHeader *pHdr); +DWORD __fastcall sync_update(int pnum, const BYTE *pbBuf); +void __fastcall sync_monster(int pnum, const TSyncMonster *p); void __cdecl sync_init(); #endif /* __SYNC_H__ */