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

Function CanPut

Source/inv.cpp:1673–1708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673BOOL CanPut(int x, int y)
1674{
1675 char oi, oi2;
1676
1677 if (dItem[x][y])
1678 return FALSE;
1679 if (nSolidTable[dPiece[x][y]])
1680 return FALSE;
1681
1682 if (dObject[x][y]) {
1683 if (object[dObject[x][y] > 0 ? dObject[x][y] - 1 : -1 - dObject[x][y]]._oSolidFlag)
1684 return FALSE;
1685 }
1686
1687 oi = dObject[x + 1][y + 1];
1688 if (oi > 0 && object[oi - 1]._oSelFlag != 0) {
1689 return FALSE;
1690 }
1691 if (oi < 0 && object[-(oi + 1)]._oSelFlag != 0) {
1692 return FALSE;
1693 }
1694
1695 oi = dObject[x + 1][y];
1696 if (oi > 0) {
1697 oi2 = dObject[x][y + 1];
1698 if (oi2 > 0 && object[oi - 1]._oSelFlag != 0 && object[oi2 - 1]._oSelFlag != 0)
1699 return FALSE;
1700 }
1701
1702 if (currlevel == 0 && dMonster[x][y] != 0)
1703 return FALSE;
1704 if (currlevel == 0 && dMonster[x + 1][y + 1] != 0)
1705 return FALSE;
1706
1707 return TRUE;
1708}
1709
1710BOOL TryInvPut()
1711{

Callers 4

DeltaLoadLevelFunction · 0.85
TryInvPutFunction · 0.85
InvPutItemFunction · 0.85
SyncPutItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected