- made Blood's inventory cycle-able.

IMO it's a totally annoying limitations to block wraparound of the cursor.
This commit is contained in:
Christoph Oelckers 2020-08-27 22:29:45 +02:00
parent 447573aa36
commit e0ca98602d

View file

@ -545,30 +545,43 @@ void packPrevItem(PLAYER *pPlayer)
{ {
if (pPlayer->packItemTime > 0) if (pPlayer->packItemTime > 0)
{ {
for (int nPrev = ClipLow(pPlayer->packItemId-1,0); nPrev >= 0; nPrev--) for (int i = 0; i < 2; i++)
{
for (int nPrev = pPlayer->packItemId-1; nPrev >= 0; nPrev--)
{ {
if (pPlayer->packSlots[nPrev].curAmount) if (pPlayer->packSlots[nPrev].curAmount)
{ {
pPlayer->packItemId = nPrev; pPlayer->packItemId = nPrev;
break; pPlayer->packItemTime = 600;
return;
} }
} }
pPlayer->packItemId = 4;
if (pPlayer->packSlots[4].curAmount) break;
} }
}
pPlayer->packItemTime = 600; pPlayer->packItemTime = 600;
} }
void packNextItem(PLAYER *pPlayer) void packNextItem(PLAYER* pPlayer)
{ {
if (pPlayer->packItemTime > 0) if (pPlayer->packItemTime > 0)
{ {
for (int nNext = ClipHigh(pPlayer->packItemId+1,5); nNext < 5; nNext++) for (int i = 0; i < 2; i++)
{
for (int nNext = pPlayer->packItemId + 1; nNext < 5; nNext++)
{ {
if (pPlayer->packSlots[nNext].curAmount) if (pPlayer->packSlots[nNext].curAmount)
{ {
pPlayer->packItemId = nNext; pPlayer->packItemId = nNext;
break; pPlayer->packItemTime = 600;
return;
} }
} }
pPlayer->packItemId = 0;
if (pPlayer->packSlots[0].curAmount) break;
}
} }
pPlayer->packItemTime = 600; pPlayer->packItemTime = 600;
} }