- 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,29 +545,42 @@ 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++)
{ {
if (pPlayer->packSlots[nPrev].curAmount) for (int nPrev = pPlayer->packItemId-1; nPrev >= 0; nPrev--)
{ {
pPlayer->packItemId = nPrev; if (pPlayer->packSlots[nPrev].curAmount)
break; {
pPlayer->packItemId = nPrev;
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++)
{ {
if (pPlayer->packSlots[nNext].curAmount) for (int nNext = pPlayer->packItemId + 1; nNext < 5; nNext++)
{ {
pPlayer->packItemId = nNext; if (pPlayer->packSlots[nNext].curAmount)
break; {
pPlayer->packItemId = nNext;
pPlayer->packItemTime = 600;
return;
}
} }
pPlayer->packItemId = 0;
if (pPlayer->packSlots[0].curAmount) break;
} }
} }
pPlayer->packItemTime = 600; pPlayer->packItemTime = 600;