From 5741d5e371eec5dc6d693fa8236bb39a90e1436c Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 10 Jan 2008 20:20:19 +0000 Subject: [PATCH] opl must be sent in all cases for proper display of vendor items minor bug in name verification --- Scripts/Misc/NameVerification.cs | 2 +- Scripts/Mobiles/Vendors/BaseVendor.cs | 28 ++++++++++++--------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Scripts/Misc/NameVerification.cs b/Scripts/Misc/NameVerification.cs index da9537c6a..6682d8e80 100644 --- a/Scripts/Misc/NameVerification.cs +++ b/Scripts/Misc/NameVerification.cs @@ -35,7 +35,7 @@ namespace Server.Misc public static bool Validate( string name, int minLength, int maxLength, bool allowLetters, bool allowDigits, bool noExceptionsAtStart, int maxExceptions, char[] exceptions, string[] disallowed, string[] startDisallowed ) { - if ( name.Length < minLength || name.Length > maxLength ) + if ( name == null || name.Length < minLength || name.Length > maxLength ) return false; int exceptCount = 0; diff --git a/Scripts/Mobiles/Vendors/BaseVendor.cs b/Scripts/Mobiles/Vendors/BaseVendor.cs index 68d0c3cac..143ea17c3 100644 --- a/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -565,16 +565,14 @@ namespace Server.Mobiles list.Add( new BuyItemState( buyItem.Name, cont.Serial, disp == null ? (Serial) 0x7FC0FFEE : disp.Serial, buyItem.Price, buyItem.Amount, buyItem.ItemID, buyItem.Hue ) ); count++; - if ( ObjectPropertyList.Enabled ) { - if ( opls == null ) { - opls = new List(); - } + if ( opls == null ) { + opls = new List(); + } - if ( disp is Item ) { - opls.Add( ( ( Item ) disp ).PropertyList ); - } else if ( disp is Mobile ) { - opls.Add( ( ( Mobile ) disp ).PropertyList ); - } + if ( disp is Item ) { + opls.Add( ( ( Item ) disp ).PropertyList ); + } else if ( disp is Mobile ) { + opls.Add( ( ( Mobile ) disp ).PropertyList ); } } @@ -613,13 +611,11 @@ namespace Server.Mobiles list.Add( new BuyItemState( name, cont.Serial, item.Serial, price, item.Amount, item.ItemID, item.Hue ) ); count++; - if ( ObjectPropertyList.Enabled ) { - if ( opls == null ) { - opls = new List(); - } - - opls.Add( item.PropertyList ); + if ( opls == null ) { + opls = new List(); } + + opls.Add( item.PropertyList ); } } @@ -644,7 +640,7 @@ namespace Server.Mobiles from.Send( new DisplayBuyList( this ) ); from.Send( new MobileStatusExtended( from ) );//make sure their gold amount is sent - if ( ObjectPropertyList.Enabled && opls != null ) { + if ( opls != null ) { for ( int i = 0; i < opls.Count; ++i ) { from.Send( opls[i] ); }