Browse Source

Cleanup VerifyGoldSeeds

pull/1695/head
Vladimir Olteanu 5 years ago committed by Anders Jenbo
parent
commit
0414871265
  1. 26
      Source/pack.cpp

26
Source/pack.cpp

@ -187,20 +187,20 @@ void UnPackItem(const PkItemStruct *is, ItemStruct *id, bool isHellfire)
*id = items[MAXITEMS];
}
void VerifyGoldSeeds(PlayerStruct *pPlayer)
static void VerifyGoldSeeds(PlayerStruct *player)
{
int i, j;
for (i = 0; i < pPlayer->_pNumInv; i++) {
if (pPlayer->InvList[i].IDidx == IDI_GOLD) {
for (j = 0; j < pPlayer->_pNumInv; j++) {
if (i != j) {
if (pPlayer->InvList[j].IDidx == IDI_GOLD && pPlayer->InvList[i]._iSeed == pPlayer->InvList[j]._iSeed) {
pPlayer->InvList[i]._iSeed = AdvanceRndSeed();
j = -1;
}
}
}
for (int i = 0; i < player->_pNumInv; i++) {
if (player->InvList[i].IDidx != IDI_GOLD)
continue;
for (int j = 0; j < player->_pNumInv; j++) {
if (i == j)
continue;
if (player->InvList[j].IDidx != IDI_GOLD)
continue;
if (player->InvList[i]._iSeed != player->InvList[j]._iSeed)
continue;
player->InvList[i]._iSeed = AdvanceRndSeed();
j = -1;
}
}
}

Loading…
Cancel
Save