Skip to content

Commit

Permalink
Fixed the gold amount for larger piles of gold. The binary reader is …
Browse files Browse the repository at this point in the history
…pretty busted and I have no idea how it's even working as well as it is
  • Loading branch information
nooperation committed Sep 13, 2022
1 parent 449d14a commit 90c41a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion D2Hackit/Core/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,13 @@ BOOL D2ParseItem(const BYTE *aPacket, DWORD aLen, ITEM& item)
if (!_stricmp(item.szItemCode, "gld"))
{
if(iPacket.GetField(1))
item.dwGoldAmount = iPacket.GetField(32);
{
item.dwGoldAmount =
(iPacket.GetField(8) & 0xFF) << 0 |
(iPacket.GetField(8) & 0xFF) << 8 |
(iPacket.GetField(8) & 0xFF) << 16 |
(iPacket.GetField(8) & 0xFF) << 24;
}
else
item.dwGoldAmount = iPacket.GetField(12);
return TRUE;
Expand Down

0 comments on commit 90c41a9

Please sign in to comment.