Index: ./Scripts/Engines/BulkOrders/Books/BOBGump.cs
===================================================================
--- ./Scripts/Engines/BulkOrders/Books/BOBGump.cs (revision 343)
+++ ./Scripts/Engines/BulkOrders/Books/BOBGump.cs (working copy)
@@ -107,7 +107,63 @@
return index;
}
- public int GetCountForIndex( int index )
+ public int GetPageForIndex(int index, int sizeDropped)
+ {
+ int count = 0;
+
+ if (index <= 0)
+ return 0;
+
+ // index++;
+ int add = 0;
+ int page = 0;
+
+ ArrayList list = m_List;
+ int i; object obj;
+
+ for (i = 0; i < index && i < list.Count; i++)
+ {
+ obj = list[i];
+ if (CheckFilter(obj))
+ {
+ if (obj is BOBLargeEntry)
+ add = ((BOBLargeEntry)obj).Entries.Length;
+ else
+ add = 1;
+ count += add;
+ if (count > 10)
+ {
+ page++;
+ count = add;
+ }
+ }
+ }
+ // now we are on the page of the bod preceeding the dropped one. let's
+ // let's see if we have to remain on this.
+
+ i++; // move the bod-counter to the sccuessor bod of the dropped one
+ // this increment seems necessary as the bod is not yet removed from m_List
+
+ if (count + sizeDropped > 10) {
+ while (i < list.Count && count <= 10)
+ {
+ obj = list[i];
+ if (CheckFilter(obj))
+ {
+ if (obj is BOBLargeEntry)
+ count += ((BOBLargeEntry)obj).Entries.Length;
+ else
+ count += 1;
+ }
+ i++;
+ }
+ if (count > 10)
+ page++;
+ }
+ return page;
+ }
+
+ public int GetCountForIndex(int index)
{
int slots = 0;
int count = 0;
@@ -256,16 +312,26 @@
if ( item != null )
{
- m_From.AddToBackpack( item );
- m_From.SendLocalizedMessage( 1045152 ); // The bulk order deed has been placed in your backpack.
+ int sizeOfDroppedBod;
+ if (obj is BOBLargeEntry)
+ sizeOfDroppedBod = ((BOBLargeEntry)obj).Entries.Length;
+ else
+ sizeOfDroppedBod = 1;
- m_Book.Entries.Remove( obj );
- m_Book.InvalidateProperties();
+ 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_From.SendGump( new BOBGump( m_From, m_Book, 0, null ) );
- else
- m_From.SendLocalizedMessage( 1062381 ); // The book is empty.
+ if (m_Book.Entries.Count > 0)
+ {
+ m_Page = GetPageForIndex(index, sizeOfDroppedBod);
+ m_From.SendGump(new BOBGump(m_From, m_Book, m_Page, null));
+ }
+ else
+ m_From.SendLocalizedMessage(1062381); // The book is empty.
+
+
}
else
{