This commit is contained in:
mark 2010-10-14 10:15:30 +00:00
parent 27abe81af0
commit 35fc5ea566
2 changed files with 30 additions and 1 deletions

View file

@ -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 );
}
}
}

View file

@ -132,7 +132,7 @@ namespace Server.Engines.BulkOrders
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
dropped.Delete();
return true;
}
else