Room Designer:

- Designer now checks the argument to ensure room= format was used instead of assuming.
This commit is contained in:
Scionwest_cp 2009-11-25 21:28:11 -08:00
parent dae777bc24
commit 5b6ea538d5

View file

@ -64,9 +64,13 @@ namespace RoomDesigner
SetupRoomScript();
if (parameters.Length != 0)
{
foreach (object argument in parameters)
{
if (argument.ToString().ToLower().StartsWith("room="))
{
string rooms = Engine.GetDataPath(Engine.SaveDataTypes.Rooms);
string filename = System.IO.Path.Combine(rooms, parameters[0].ToString());
string filename = System.IO.Path.Combine(rooms, argument.ToString());
//Room to load should always be the first arg.
if (System.IO.File.Exists(filename))
@ -74,6 +78,8 @@ namespace RoomDesigner
_CurrentRoom = (Room)ManagedScripting.XmlSerialization.Load(filename, _CurrentRoom);
}
}
}
}
//Show the user(s) the rooms properties