MCPcopy Create free account
hub / github.com/diasurgical/devilution / On_GETITEM

Function On_GETITEM

Source/msg.cpp:1439–1464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1437}
1438
1439DWORD On_GETITEM(TCmd *pCmd, int pnum)
1440{
1441 TCmdGItem *p = (TCmdGItem *)pCmd;
1442
1443 if (gbBufferMsgs == 1)
1444 msg_send_packet(pnum, p, sizeof(*p));
1445 else {
1446 int ii = FindGetItem(p->wIndx, p->wCI, p->dwSeed);
1447 if (delta_get_item(p, p->bLevel)) {
1448 if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) {
1449 if (p->bPnum == myplr) {
1450 if (currlevel != p->bLevel) {
1451 ii = SyncPutItem(myplr, plr[myplr].WorldX, plr[myplr].WorldY, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff);
1452 if (ii != -1)
1453 InvGetItem(myplr, ii);
1454 } else
1455 InvGetItem(myplr, ii);
1456 } else
1457 SyncGetItem(p->x, p->y, p->wIndx, p->wCI, p->dwSeed);
1458 }
1459 } else
1460 NetSendCmdGItem2(TRUE, CMD_GETITEM, p->bMaster, p->bPnum, p);
1461 }
1462
1463 return sizeof(*p);
1464}
1465
1466BOOL delta_get_item(TCmdGItem *pI, BYTE bLevel)
1467{

Callers 1

ParseCmdFunction · 0.85

Calls 7

msg_send_packetFunction · 0.85
FindGetItemFunction · 0.85
delta_get_itemFunction · 0.85
SyncPutItemFunction · 0.85
InvGetItemFunction · 0.85
SyncGetItemFunction · 0.85
NetSendCmdGItem2Function · 0.85

Tested by

no test coverage detected