Fixed modified structure colors not being cloned. Closes #212

This commit is contained in:
Joonas Rikkonen
2017-12-29 15:31:46 +02:00
parent 4d55e2dd55
commit fe54b75117
@@ -277,7 +277,13 @@ namespace Barotrauma
public override MapEntity Clone() public override MapEntity Clone()
{ {
return new Structure(rect, prefab, Submarine); var clone = new Structure(rect, prefab, Submarine);
foreach (KeyValuePair<string, SerializableProperty> property in SerializableProperties)
{
if (!property.Value.Attributes.OfType<Editable>().Any()) continue;
clone.SerializableProperties[property.Key].TrySetValue(property.Value.GetValue());
}
return clone;
} }
private void CreateStairBodies() private void CreateStairBodies()