diff --git a/Source/items.cpp b/Source/items.cpp index 181b906bc..abdc92cf8 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -2251,10 +2251,9 @@ void CreateItem(int uid, int x, int y) } // 422290: could not find valid save-restore pair for esi -void CreateRndItem(int x, int y, unsigned char onlygood, unsigned char sendmsg, int delta) +void CreateRndItem(int x, int y, BOOL onlygood, BOOL sendmsg, int delta) { - int idx; // edi - int ii; // esi + int idx, ii; if (onlygood) idx = RndUItem(-1); @@ -2263,17 +2262,15 @@ void CreateRndItem(int x, int y, unsigned char onlygood, unsigned char sendmsg, if (numitems < MAXITEMS) { ii = itemavail[0]; - GetSuperItemSpace(x, y, itemavail[0]); - itemactive[numitems] = ii; + GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; + itemactive[numitems] = ii; SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, onlygood, 0, delta); - if (sendmsg) NetSendCmdDItem(FALSE, ii); if (delta) DeltaAddItem(ii); - - ++numitems; + numitems++; } } diff --git a/Source/items.h b/Source/items.h index ad592f0ef..bdbabb3da 100644 --- a/Source/items.h +++ b/Source/items.h @@ -58,7 +58,7 @@ void ItemRndDur(int ii); void SetupAllItems(int ii, int idx, int iseed, int lvl, int uper, int onlygood, int recreate, int pregen); void SpawnItem(int m, int x, int y, BOOL sendmsg); void CreateItem(int uid, int x, int y); -void CreateRndItem(int x, int y, unsigned char onlygood, unsigned char sendmsg, int delta); +void CreateRndItem(int x, int y, BOOL onlygood, BOOL sendmsg, int delta); void SetupAllUseful(int ii, int iseed, int lvl); void CreateRndUseful(int pnum, int x, int y, BOOL sendmsg); void CreateTypeItem(int x, int y, BOOL onlygood, int itype, int imisc, BOOL sendmsg, int delta);