From 14e4162d353f2096e311c1a438247563b6e0a1f3 Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Sat, 17 Oct 2020 11:09:53 +0200 Subject: [PATCH] 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 --- Source/Plugins/BuilderModes/General/CopyStructures.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Plugins/BuilderModes/General/CopyStructures.cs b/Source/Plugins/BuilderModes/General/CopyStructures.cs index f22f680d..707742f8 100755 --- a/Source/Plugins/BuilderModes/General/CopyStructures.cs +++ b/Source/Plugins/BuilderModes/General/CopyStructures.cs @@ -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);