gilgamash
Knight
page after BOD drop
Greets,
I would embrace if, after dropping a bod from a bod-book, the book did not return to the first page.
So here my suggestion of how to avoid this; have done only some minor testing so far, but it seems to work (including, e.g., turning to a previous page in case the dropped bod was the only one of the current page)
-----------
Into BOBGumps.cs
insert this function into the class:
and change the drop part (line 274 ff) to
G.
Greets,
I would embrace if, after dropping a bod from a bod-book, the book did not return to the first page.
So here my suggestion of how to avoid this; have done only some minor testing so far, but it seems to work (including, e.g., turning to a previous page in case the dropped bod was the only one of the current page)
-----------
Into BOBGumps.cs
insert this function into the class:
Code:
public int GetPageForIndex(int index)
{
iint count = 0;
if (index <= 0)
return 0;
ArrayList list = m_List;
for (int i = 0; i < index && i < list.Count; i++)
{
object obj = list[i];
if (CheckFilter(obj))
{
if (obj is BOBLargeEntry)
count += ((BOBLargeEntry)obj).Entries.Length;
else
count++;
}
}
return (int)((count / 10) - Convert.ToInt32((count % 10) == 0));
}
and change the drop part (line 274 ff) to
Code:
if ( type == 0 ) // Drop
{
if ( m_Book.IsChildOf( m_From.Backpack ) )
{
Item item = Reconstruct( obj );
if ( item != null )
{
m_From.AddToBackpack( item );
m_From.SendLocalizedMessage( 1045152 ); // The bulk order deed has been placed in your backpack.
m_Book.Entries.Remove( obj );
m_Book.InvalidateProperties();
if (m_Book.Entries.Count > 0)
{
m_Page = GetPageForIndex(index);
m_From.SendGump(new BOBGump(m_From, m_Book, m_Page, null));
}
else
m_From.SendLocalizedMessage(1062381); // The book is empty.
}
else
{
m_From.SendMessage( "Internal error. The bulk order deed could not be reconstructed." );
}
}
}
G.