Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
andreakarasho committed Oct 26, 2020
2 parents 7990318 + 2984063 commit e37d0cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.1.5.{build}
version: 0.1.6.{build}
pull_requests:
do_not_increment_build_number: true
branches:
Expand Down
2 changes: 1 addition & 1 deletion src/Game/UI/Gumps/CounterBarGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public override void Update(double totalTime, double frameTime)

for (Item item = (Item) World.Player.Items; item != null; item = (Item) item.Next)
{
if (item.ItemData.IsContainer && !item.IsEmpty)
if (item.ItemData.IsContainer && !item.IsEmpty && item.Layer >= Layer.OneHanded && item.Layer <= Layer.Legs)
{
GetAmount(item, Graphic, Hue, ref _amount);
}
Expand Down
15 changes: 13 additions & 2 deletions src/Network/PacketHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2166,8 +2166,19 @@ private static void BookData(Packet p)

for (int line = 0; line < lineCnt; line++)
{
gump.BookLines[pageNum * ModernBookGump.MAX_BOOK_LINES + line] =
ModernBookGump.IsNewBook ? p.ReadUTF8StringSafe() : p.ReadASCII();
int index = pageNum * ModernBookGump.MAX_BOOK_LINES + line;

if (index < gump.BookLines.Length)
{
gump.BookLines[index] = ModernBookGump.IsNewBook ? p.ReadUTF8StringSafe() : p.ReadASCII();
}
else
{
Log.Error
(
"BOOKGUMP: The server is sending a page number GREATER than the allowed number of pages in BOOK!"
);
}
}

if (lineCnt < ModernBookGump.MAX_BOOK_LINES)
Expand Down

0 comments on commit e37d0cd

Please sign in to comment.