Release v0.15.13.0

This commit is contained in:
Joonas Rikkonen
2021-11-02 13:19:48 +02:00
parent a52a23f8c2
commit 3a35dbfe6c
77 changed files with 509 additions and 224 deletions
@@ -225,10 +225,23 @@ namespace Barotrauma.Items.Components
//no electrocution in sub editor
if (Screen.Selected == GameMain.SubEditorScreen) { return true; }
var powered = item.GetComponent<Powered>();
if (powered != null)
var reactor = item.GetComponent<Reactor>();
if (reactor != null)
{
//unpowered panels can be rewired without a risk of electrical shock
//reactors that arent generating power atm can be rewired without the risk of electrical shock
if (MathUtils.NearlyEqual(reactor.CurrPowerConsumption, 0.0f)) { return true; }
}
var powerContainer = item.GetComponent<PowerContainer>();
if (powerContainer != null)
{
//empty batteries/supercapacitors can be rewired without the risk of electrical shock
//non-empty ones always have a chance of zapping the user
if (powerContainer.Charge <= 0.0f) { return true; }
}
var powered = item.GetComponent<Powered>();
if (powered != null && powerContainer == null)
{
//unpowered panels can be rewired without the risk of electrical shock
if (powered.Voltage < 0.1f) { return true; }
}