From 35fc5ea566fe01dd63cacf0a467d2ccd8b76b4e5 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 14 Oct 2010 10:15:30 +0000 Subject: [PATCH] misc --- Scripts/Commands/Properties.cs | 29 +++++++++++++++++++ .../Engines/BulkOrders/Books/BulkOrderBook.cs | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Scripts/Commands/Properties.cs b/Scripts/Commands/Properties.cs index 82850a739..1ab9766fe 100644 --- a/Scripts/Commands/Properties.cs +++ b/Scripts/Commands/Properties.cs @@ -526,6 +526,24 @@ namespace Server.Commands } } + public static string SetDirect( object obj, PropertyInfo prop, object toSet ) + { + try + { + if ( toSet is AccessLevel ) + { + return "You do not have access to that level."; + } + + prop.SetValue( obj, toSet, null ); + return "Property has been set."; + } + catch + { + return "An exception was caught, the property may not be set."; + } + } + public static string InternalSetValue( Mobile from, object logobj, object o, PropertyInfo p, string pname, string value, bool shouldLog ) { object toSet = null; @@ -536,6 +554,17 @@ namespace Server.Commands return SetDirect( from, logobj, o, p, pname, toSet, shouldLog ); } + + public static string InternalSetValue( object o, PropertyInfo p, string value ) + { + object toSet = null; + string result = ConstructFromString( p.PropertyType, o, value, ref toSet ); + + if ( result != null ) + return result; + + return SetDirect( o, p, toSet ); + } } } diff --git a/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs b/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs index 70018506e..efa32b289 100644 --- a/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs +++ b/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs @@ -132,7 +132,7 @@ namespace Server.Engines.BulkOrders from.SendGump( new BOBGump( (PlayerMobile)from, this ) ); dropped.Delete(); - + return true; } else