Skip to content

Commit

Permalink
[hellfire] CreateRndUseful bin exact
Browse files Browse the repository at this point in the history
  • Loading branch information
qndel authored and AJenbo committed Sep 15, 2019
1 parent fda12d4 commit 19d7286
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -2463,31 +2470,25 @@ 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;
}
}
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];
Expand Down

0 comments on commit 19d7286

Please sign in to comment.