Fixed PowerContainer RechargeSpeed being capped to the MaxRechargeSpeed set in the prefab due to RechargeSpeed being loaded before MaxRechargeSpeed. Closes #612

This commit is contained in:
Joonas Rikkonen
2018-08-08 15:56:19 +03:00
parent bcd44f79e9
commit 2f0236d99b

View File

@@ -63,6 +63,14 @@ namespace Barotrauma.Items.Components
}
}
}
[Serialize(10.0f, true), Editable(ToolTip = "How fast the device can be recharged. "+
"For example, a recharge speed of 100 kW and a capacity of 1000 kW*min would mean it takes 10 minutes to fully charge the device.")]
public float MaxRechargeSpeed
{
get { return maxRechargeSpeed; }
set { maxRechargeSpeed = Math.Max(value, 1.0f); }
}
[Serialize(10.0f, true), Editable]
public float RechargeSpeed
@@ -76,14 +84,6 @@ namespace Barotrauma.Items.Components
}
}
[Serialize(10.0f, true), Editable(ToolTip = "How fast the device can be recharged. "+
"For example, a recharge speed of 100 kW and a capacity of 1000 kW*min would mean it takes 10 minutes to fully charge the device.")]
public float MaxRechargeSpeed
{
get { return maxRechargeSpeed; }
set { maxRechargeSpeed = Math.Max(value, 1.0f); }
}
public PowerContainer(Item item, XElement element)
: base(item, element)
{