lots of little stuff, but mostly bank optimization, due to the weirdness of the calls
This commit is contained in:
parent
566de1c2cf
commit
f95101c201
29 changed files with 214 additions and 282 deletions
|
|
@ -109,7 +109,7 @@ namespace Server.Gumps
|
|||
{
|
||||
BankBox box = m_Mobile.BankBox;
|
||||
|
||||
if ( box != null && box.TryDropItem( m_Mobile, toGive, false ) )
|
||||
if ( box.TryDropItem( m_Mobile, toGive, false ) )
|
||||
{
|
||||
if ( toGive is BankCheck )
|
||||
m_Mobile.SendLocalizedMessage( 1060397, ((BankCheck)toGive).Worth.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box.
|
||||
|
|
|
|||
|
|
@ -66,8 +66,10 @@ namespace Server.Gumps
|
|||
if ( from.Backpack != null )
|
||||
totalGold += from.Backpack.GetAmount( typeof( Gold ) );
|
||||
|
||||
if ( from.BankBox != null )
|
||||
totalGold += from.BankBox.GetAmount( typeof( Gold ) );
|
||||
BankBox bank = from.FindBankNoCreate();
|
||||
|
||||
if ( bank != null )
|
||||
totalGold += bank.GetAmount( typeof( Gold ) );
|
||||
|
||||
if ( totalGold < m_VI.Price )
|
||||
{
|
||||
|
|
@ -83,9 +85,9 @@ namespace Server.Gumps
|
|||
|
||||
if ( from.Backpack != null )
|
||||
leftPrice -= from.Backpack.ConsumeUpTo( typeof( Gold ), leftPrice );
|
||||
|
||||
if ( leftPrice > 0 && from.BankBox != null )
|
||||
from.BankBox.ConsumeUpTo( typeof( Gold ), leftPrice );
|
||||
|
||||
if ( leftPrice > 0 && bank != null )
|
||||
bank.ConsumeUpTo( typeof( Gold ), leftPrice );
|
||||
|
||||
m_Vendor.HoldGold += m_VI.Price;
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Server.Gumps
|
|||
inventory.Items.RemoveAt( i );
|
||||
givenToBackpack += 1 + item.TotalItems;
|
||||
}
|
||||
else if ( from.BankBox != null && from.BankBox.TryDropItem( from, item, false ) )
|
||||
else if ( from.BankBox.TryDropItem( from, item, false ) )
|
||||
{
|
||||
inventory.Items.RemoveAt( i );
|
||||
givenToBankBox += 1 + item.TotalItems;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue