diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index 7cd5f7ee..d465bb34 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -545,6 +545,16 @@ namespace CodeImp.DoomBuilder.Config t.Type = defaultthingtype; t.Rotate(defaultthingangle); foreach(string f in defaultthingflags) t.SetFlag(f, true); + + //mxd. Set default arguments + ThingTypeInfo tti = General.Map.Data.GetThingInfoEx(t.Type); + if (tti != null) { + t.Args[0] = (int)tti.Args[0].DefaultValue; + t.Args[1] = (int)tti.Args[1].DefaultValue; + t.Args[2] = (int)tti.Args[2].DefaultValue; + t.Args[3] = (int)tti.Args[3].DefaultValue; + t.Args[4] = (int)tti.Args[4].DefaultValue; + } } // This attempts to find the default drawing settings diff --git a/Source/Core/Data/DataManager.cs b/Source/Core/Data/DataManager.cs index eab0910b..53e1f731 100644 --- a/Source/Core/Data/DataManager.cs +++ b/Source/Core/Data/DataManager.cs @@ -1358,11 +1358,9 @@ namespace CodeImp.DoomBuilder.Data // Return from config return thingtypes[thingtype]; } - else - { - // Create unknown thing info - return new ThingTypeInfo(thingtype); - } + + // Create unknown thing info + return new ThingTypeInfo(thingtype); } // This gets thing information by index @@ -1375,11 +1373,9 @@ namespace CodeImp.DoomBuilder.Data // Return from config return thingtypes[thingtype]; } - else - { - // No such thing type known - return null; - } + + // No such thing type known + return null; } #endregion diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs index 5806c064..4becf24e 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs @@ -730,10 +730,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { // Redraw screen General.Interface.RedrawDisplay(); - - List things = new List(1); - things.Add(t); - General.Interface.ShowEditThings(things); + General.Interface.ShowEditThings(new List { t }); } General.Interface.DisplayStatus(StatusType.Action, "Inserted a new thing.");