From 19d7286497c312a44cad991b3cda37af16c140aa Mon Sep 17 00:00:00 2001 From: qndel Date: Sun, 15 Sep 2019 18:49:53 +0200 Subject: [PATCH] [hellfire] CreateRndUseful bin exact --- Source/items.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 27968ea22..50bdbb0ae 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -2345,12 +2345,19 @@ void CreateRndUseful(int pnum, int x, int y, BOOL sendmsg) { int ii; +#ifdef HELLFIRE + int curlv = items_get_currlevel(); +#endif if (numitems < MAXITEMS) { ii = itemavail[0]; GetSuperItemSpace(x, y, ii); itemavail[0] = itemavail[MAXITEMS - numitems - 1]; itemactive[numitems] = ii; +#ifdef HELLFIRE + SetupAllUseful(ii, GetRndSeed(), curlv); +#else SetupAllUseful(ii, GetRndSeed(), currlevel); +#endif if (sendmsg) { NetSendCmdDItem(FALSE, ii); } @@ -2463,20 +2470,16 @@ void items_427ABA(int x, int y) DWORD dwSize; PkItemStruct PkSItem; - if ( dword_691CB0 || x == 0 || y == 0 ) - { + if (dword_691CB0 || x == 0 || y == 0) { return; } CornerItemMaybe.IDidx = 0; dword_691CB0 = 1; - if ( dItem[x][y] ) - { + if (dItem[x][y]) { ii = dItem[x][y] - 1; - for ( i = 0; i < numitems; i++ ) - { - if ( itemactive[i] == ii ) - { + for (i = 0; i < numitems; i++) { + if (itemactive[i] == ii) { DeleteItem(ii, i); break; } @@ -2484,10 +2487,8 @@ void items_427ABA(int x, int y) dItem[x][y] = 0; } dwSize = 0; - if ( SRegLoadData("Hellfire", off_4A5AC4, 0, (BYTE *)&PkSItem, sizeof(PkSItem), &dwSize) ) - { - if ( dwSize == sizeof(PkSItem) ) - { + if (SRegLoadData("Hellfire", off_4A5AC4, 0, (BYTE *)&PkSItem, sizeof(PkSItem), &dwSize)) { + if (dwSize == sizeof(PkSItem)) { ii = itemavail[0]; dItem[x][y] = ii + 1; itemavail[0] = itemavail[MAXITEMS - numitems - 1];