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

Function InvGetItem

Source/inv.cpp:1451–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1449}
1450
1451void InvGetItem(int pnum, int ii)
1452{
1453 int i;
1454
1455 if (dropGoldFlag) {
1456 dropGoldFlag = FALSE;
1457 dropGoldValue = 0;
1458 }
1459
1460 if (dItem[item[ii]._ix][item[ii]._iy]) {
1461 if (myplr == pnum && pcurs >= CURSOR_FIRSTITEM)
1462 NetSendCmdPItem(TRUE, CMD_SYNCPUTITEM, plr[myplr].WorldX, plr[myplr].WorldY);
1463 item[ii]._iCreateInfo &= ~0x8000;
1464 plr[pnum].HoldItem = item[ii];
1465 CheckQuestItem(pnum);
1466 CheckBookLevel(pnum);
1467 CheckItemStats(pnum);
1468 dItem[item[ii]._ix][item[ii]._iy] = 0;
1469 i = 0;
1470 while (i < numitems) {
1471 if (itemactive[i] == ii) {
1472 DeleteItem(itemactive[i], i);
1473 i = 0;
1474 } else {
1475 i++;
1476 }
1477 }
1478 pcursitem = -1;
1479 SetCursor_(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM);
1480 }
1481}
1482
1483void AutoGetItem(int pnum, int ii)
1484{

Callers 2

On_REQUESTGITEMFunction · 0.85
On_GETITEMFunction · 0.85

Calls 6

NetSendCmdPItemFunction · 0.85
CheckQuestItemFunction · 0.85
CheckBookLevelFunction · 0.85
CheckItemStatsFunction · 0.85
DeleteItemFunction · 0.85
SetCursor_Function · 0.85

Tested by

no test coverage detected