From 04148712655ee0f9312084e16014b0bf044637ea Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Thu, 29 Apr 2021 02:01:48 +0300 Subject: [PATCH] Cleanup VerifyGoldSeeds --- Source/pack.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/pack.cpp b/Source/pack.cpp index 1ceddf820..f7c3415f3 100644 --- a/Source/pack.cpp +++ b/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; } } }