(fc1332bcb) Fixed structures getting scaled incorrectly when cloning a structure with a non-default scale in the sub editor

This commit is contained in:
Joonas Rikkonen
2019-05-23 15:16:23 +03:00
parent 950425174d
commit 5392a8b0d7
@@ -366,14 +366,18 @@ namespace Barotrauma
public override MapEntity Clone()
{
var clone = new Structure(rect, Prefab, Submarine);
var clone = new Structure(rect, Prefab, Submarine)
{
defaultRect = defaultRect
};
foreach (KeyValuePair<string, SerializableProperty> property in SerializableProperties)
{
if (!property.Value.Attributes.OfType<Editable>().Any()) continue;
if (!property.Value.Attributes.OfType<Editable>().Any()) { continue; }
clone.SerializableProperties[property.Key].TrySetValue(clone, property.Value.GetValue(this));
}
if (FlippedX) clone.FlipX(false);
if (FlippedY) clone.FlipY(false);
return clone;
}