Default thing arguments were not set when creating a new thing, only when changing thing type in Edit Things window.

This commit is contained in:
MaxED 2014-02-21 15:24:54 +00:00
parent 3e5f85dc8f
commit 21889a98e7
3 changed files with 17 additions and 14 deletions

View file

@ -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

View file

@ -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

View file

@ -730,10 +730,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Redraw screen
General.Interface.RedrawDisplay();
List<Thing> things = new List<Thing>(1);
things.Add(t);
General.Interface.ShowEditThings(things);
General.Interface.ShowEditThings(new List<Thing> { t });
}
General.Interface.DisplayStatus(StatusType.Action, "Inserted a new thing.");