lots of little stuff, but mostly bank optimization, due to the weirdness of the calls

This commit is contained in:
mark 2007-01-19 22:10:11 +00:00
parent 566de1c2cf
commit f95101c201
29 changed files with 214 additions and 282 deletions

View file

@ -36,7 +36,7 @@ namespace Server.Mobiles
{
int balance = 0;
Container bank = from.BankBox;
Container bank = from.FindBankNoCreate();
if ( bank != null )
{
@ -100,7 +100,7 @@ namespace Server.Mobiles
public static bool Deposit( Mobile from, int amount )
{
BankBox box = from.BankBox;
BankBox box = from.FindBankNoCreate();
if ( box == null )
return false;
@ -146,7 +146,7 @@ namespace Server.Mobiles
public static int DepositUpTo( Mobile from, int amount )
{
BankBox box = from.BankBox;
BankBox box = from.FindBankNoCreate();
if ( box == null )
return 0;
@ -265,7 +265,7 @@ namespace Server.Mobiles
}
else if ( amount > 0 )
{
BankBox box = e.Mobile.BankBox;
BankBox box = e.Mobile.FindBankNoCreate();
if ( box == null || !box.ConsumeTotal( typeof( Gold ), amount ) )
{
@ -292,12 +292,12 @@ namespace Server.Mobiles
break;
}
BankBox box = e.Mobile.BankBox;
BankBox box = e.Mobile.FindBankNoCreate();
if ( box != null )
{
this.Say( 1042759, box.TotalGold.ToString() ); // Thy current bank balance is ~1_AMOUNT~ gold.
}
else
this.Say( 1042759, "0" ); // Thy current bank balance is ~1_AMOUNT~ gold.
break;
}
@ -311,10 +311,7 @@ namespace Server.Mobiles
break;
}
BankBox box = e.Mobile.BankBox;
if ( box != null )
box.Open();
e.Mobile.BankBox.Open();
break;
}
@ -357,7 +354,7 @@ namespace Server.Mobiles
BankBox box = e.Mobile.BankBox;
if ( box == null || !box.TryDropItem( e.Mobile, check, false ) )
if ( !box.TryDropItem( e.Mobile, check, false ) )
{
this.Say( 500386 ); // There's not enough room in your bankbox for the check!
check.Delete();

View file

@ -306,7 +306,7 @@ namespace Server.Mobiles
Gold gold = new Gold( 500, 1000 );
if ( cont == null || !cont.TryDropItem( escorter, gold, false ) )
if ( !cont.TryDropItem( escorter, gold, false ) )
gold.MoveToWorld( escorter.Location, escorter.Map );
StopFollow();

View file

@ -974,7 +974,7 @@ namespace Server.Mobiles
if ( !bought && totalCost >= 2000 )
{
cont = buyer.BankBox;
cont = buyer.FindBankNoCreate();
if ( cont != null && cont.ConsumeTotal( typeof( Gold ), totalCost ) )
{
bought = true;

View file

@ -295,7 +295,7 @@ namespace Server.Mobiles
}
else
{
Container bank = from.BankBox;
Container bank = from.FindBankNoCreate();
if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
{