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

Function On_PUTITEM

Source/msg.cpp:1603–1628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1601}
1602
1603DWORD On_PUTITEM(TCmd *pCmd, int pnum)
1604{
1605 TCmdPItem *p = (TCmdPItem *)pCmd;
1606
1607 if (gbBufferMsgs == 1)
1608 msg_send_packet(pnum, p, sizeof(*p));
1609 else if (currlevel == plr[pnum].plrlevel) {
1610 int ii;
1611 if (pnum == myplr)
1612 ii = InvPutItem(pnum, p->x, p->y);
1613 else
1614 ii = SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff);
1615 if (ii != -1) {
1616 PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
1617 delta_put_item(p, item[ii]._ix, item[ii]._iy, plr[pnum].plrlevel);
1618 check_update_plr(pnum);
1619 }
1620 return sizeof(*p);
1621 } else {
1622 PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
1623 delta_put_item(p, p->x, p->y, plr[pnum].plrlevel);
1624 check_update_plr(pnum);
1625 }
1626
1627 return sizeof(*p);
1628}
1629
1630void delta_put_item(TCmdPItem *pI, int x, int y, BYTE bLevel)
1631{

Callers 1

ParseCmdFunction · 0.85

Calls 6

msg_send_packetFunction · 0.85
InvPutItemFunction · 0.85
SyncPutItemFunction · 0.85
PutItemRecordFunction · 0.85
delta_put_itemFunction · 0.85
check_update_plrFunction · 0.85

Tested by

no test coverage detected