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

Function SyncGetItem

Source/inv.cpp:1637–1671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635}
1636
1637void SyncGetItem(int x, int y, int idx, WORD ci, int iseed)
1638{
1639 int i, ii;
1640
1641 if (dItem[x][y]) {
1642 ii = dItem[x][y] - 1;
1643 if (item[ii].IDidx == idx
1644 && item[ii]._iSeed == iseed
1645 && item[ii]._iCreateInfo == ci) {
1646 FindGetItem(idx, ci, iseed);
1647 } else {
1648 ii = FindGetItem(idx, ci, iseed);
1649 }
1650 } else {
1651 ii = FindGetItem(idx, ci, iseed);
1652 }
1653
1654 if (ii != -1) {
1655 dItem[item[ii]._ix][item[ii]._iy] = 0;
1656 i = 0;
1657 while (i < numitems) {
1658 if (itemactive[i] == ii) {
1659 DeleteItem(itemactive[i], i);
1660 FindGetItem(idx, ci, iseed);
1661 /// ASSERT: assert(FindGetItem(idx,ci,iseed) == -1);
1662 FindGetItem(idx, ci, iseed); /* todo: replace with above */
1663 i = 0;
1664 } else {
1665 i++;
1666 }
1667 }
1668 /// ASSERT: assert(FindGetItem(idx, ci, iseed) == -1);
1669 FindGetItem(idx, ci, iseed); /* todo: replace with above */
1670 }
1671}
1672
1673BOOL CanPut(int x, int y)
1674{

Callers 8

On_REQUESTGITEMFunction · 0.85
On_GETITEMFunction · 0.85
On_REQUESTAGITEMFunction · 0.85
On_AGETITEMFunction · 0.85
On_ITEMEXTRAFunction · 0.85
InvPutItemFunction · 0.85
SyncPutItemFunction · 0.85
RespawnDeadItemFunction · 0.85

Calls 2

FindGetItemFunction · 0.85
DeleteItemFunction · 0.85

Tested by

no test coverage detected