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

@ -154,7 +154,9 @@ namespace Server.Engines.Plants
if ( owner.Backpack != null && IsChildOf( owner.Backpack ) )
return true;
if ( owner.BankBox != null && IsChildOf( owner.BankBox ) )
BankBox bank = owner.FindBankNoCreate();
if ( bank != null && IsChildOf( bank ) )
return true;
return false;
@ -317,7 +319,7 @@ namespace Server.Engines.Plants
public bool IsUsableBy( Mobile from )
{
Item root = RootParent as Item;
return IsChildOf( from.Backpack ) || IsChildOf( from.BankBox ) || IsLockedDown && IsAccessibleTo( from ) || root != null && root.IsSecure && root.IsAccessibleTo( from );
return IsChildOf( from.Backpack ) || IsChildOf( from.FindBankNoCreate() ) || IsLockedDown && IsAccessibleTo( from ) || root != null && root.IsSecure && root.IsAccessibleTo( from );
}
public override void OnDoubleClick( Mobile from )

View file

@ -400,9 +400,11 @@ namespace Server.Engines.Plants
}
}
if ( from.BankBox != null )
BankBox bank = from.FindBankNoCreate();
if ( bank != null )
{
Item[] plants = from.BankBox.FindItemsByType( typeof( PlantItem ) );
Item[] plants = bank.FindItemsByType( typeof( PlantItem ) );
foreach ( PlantItem plant in plants )
{