BaseScript now has a method for reporting failed Script.Load() method invocations. It will log the class name and property field if used correctly.
Some classes have some protection in place now in the event the class attempts to load a property that does not exist in the save file. CommandSystem instances now use their instanced CommandCollection property instead of the static class property.
This commit is contained in:
parent
9b475691d5
commit
f5cf0c1f6a
4 changed files with 17 additions and 5 deletions
|
@ -105,13 +105,13 @@ namespace MudEngine.Core
|
|||
string key = command.Insert(0, "Command");
|
||||
|
||||
//Loop through each Key in the Commands collection
|
||||
foreach (string k in CommandSystem.Commands.Keys)
|
||||
foreach (string k in this.CommandCollection.Keys)
|
||||
{
|
||||
//Check to see if the Key (Command Name) matches the Command we are looking for.
|
||||
if (key.ToLower().Contains(k.ToLower()))
|
||||
{
|
||||
//Grab a reference to the Command
|
||||
ICommand cmd = CommandSystem.Commands[k];
|
||||
ICommand cmd = this.CommandCollection[k];
|
||||
try
|
||||
{
|
||||
//Execute the command
|
||||
|
@ -120,7 +120,6 @@ namespace MudEngine.Core
|
|||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine("Error: " + ex.Message);
|
||||
Console.WriteLine("Error: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue