Copy/Past thing properties: fixed a crash when pasting properties from a thing that has no model assigned to a thing that has a model applied

This commit is contained in:
biwa 2020-10-17 11:09:53 +02:00
parent a7791754c1
commit 14e4162d35

View file

@ -781,6 +781,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Thing t in things)
{
if(settings.Type) t.Type = type;
// Update the setting from the configuration after changing the type. This makes sure all the following
// actions work, since there can be problems when changing the type from or to thing that has a model defined
t.UpdateConfiguration();
if(settings.Angle) t.Rotate(angle);
if(settings.ZHeight) t.Move(t.Position.x, t.Position.y, zheight);
if(settings.Pitch) t.SetPitch(pitch);