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

Function TryInvPut

Source/inv.cpp:1710–1733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1708}
1709
1710BOOL TryInvPut()
1711{
1712 int dir;
1713
1714 if (numitems >= 127)
1715 return FALSE;
1716
1717 dir = GetDirection(plr[myplr].WorldX, plr[myplr].WorldY, cursmx, cursmy);
1718 if (CanPut(plr[myplr].WorldX + offset_x[dir], plr[myplr].WorldY + offset_y[dir])) {
1719 return TRUE;
1720 }
1721
1722 dir = (dir - 1) & 7;
1723 if (CanPut(plr[myplr].WorldX + offset_x[dir], plr[myplr].WorldY + offset_y[dir])) {
1724 return TRUE;
1725 }
1726
1727 dir = (dir + 2) & 7;
1728 if (CanPut(plr[myplr].WorldX + offset_x[dir], plr[myplr].WorldY + offset_y[dir])) {
1729 return TRUE;
1730 }
1731
1732 return CanPut(plr[myplr].WorldX, plr[myplr].WorldY);
1733}
1734
1735void DrawInvMsg(char *msg)
1736{

Callers 2

LeftMouseDownFunction · 0.85
DropItemBeforeTrigFunction · 0.85

Calls 2

GetDirectionFunction · 0.85
CanPutFunction · 0.85

Tested by

no test coverage detected